- COBOL Tutorial
- Cobol 400 Reference
- As400 Cobol Reference Manual Pdf
- As400 Cobol Reference Manual Template
- As400 System User Manual
As400 Cobol Tutorial Pdf COBOL stands for Common Business-Oriented Language. The US Audience. This tutorial is designed for software programmers who would like to learn. Note: There is a more recent version of this tutorial that uses a more modern form of It assumes some prior knowledge of IBM i (aka AS/400, iSeries, System i). COBOL is a high-level language. One must understand the way COBOL works. Computers only understand machine code, a binary stream of 0s and 1s. COBOL code must be converted into machine code using a compiler. Run the program source through a compiler. The compiler first checks for any syntax errors.
Cobol 400 Reference
- COBOL Useful Resources
- Selected Reading
![As400 cobol reference manual software As400 cobol reference manual software](/uploads/1/2/6/0/126011608/585175184.png)
Character Set
'Characters' are lowest in the hierarchy and they cannot be divided further. The COBOL Character Set includes 78 characters which are shown below −
Sr.No. | Character & Description |
---|---|
1 | A-Z Alphabets(Upper Case) |
2 | a-z Alphabets (Lower Case) |
3 | 0-9 Numeric |
4 | Space |
5 | + Plus Sign |
6 | - Minus Sign or Hyphen |
7 | * Asterisk |
8 | / Forward Slash |
9 | $ Currency Sign |
10 | , Comma |
11 | ; Semicolon |
12 | . Decimal Point or Period |
13 | ' Destroy the ship in 5 seconds (hard, but not impossible) and obtain a warp to the level ahead of it. You can only do this once per level, though.Submitted by: IGN Staff Level Skip The ship at the end of each level is there for a purpose. You'll gain two options, missiles, and extra speed. Gradius nintendo game tips. Haven't you ever wondered why there is no ship at the end of level 6?Unlimited Continues Don't let the bug-eyed monsters get you down. Relax Scotty, just pause the game and press UP, UP, DOWN, DOWN, LEFT, RIGHT, LEFT, RIGHT, B, A, START. Quotation Marks |
14 | ( Left Parenthesis |
15 | ) Right Parenthesis |
16 | > Greater than |
17 | < Less than |
18 | : Colon |
19 | ' Apostrophe Trial version publisher. |
20 | = Equal Sign |
Coding Sheet
The source program of COBOL must be written in a format acceptable to the compilers. COBOL programs are written on COBOL coding sheets. There are 80 character positions on each line of a coding sheet.
Character positions are grouped into the following five fields −
Positions | Field | Description |
---|---|---|
1-6 | Column Numbers | Reserved for line numbers. |
7 | Indicator | It can have Asterisk (*) indicating comments, Hyphen (-) indicating continuation and Slash ( / ) indicating form feed. |
8-11 | Area A | All COBOL divisions, sections, paragraphs and some special entries must begin in Area A. |
12-72 | Area B | All COBOL statements must begin in area B. |
73-80 | Identification Area | It can be used as needed by the programmer. |
Example
The following example shows a COBOL coding sheet −
JCL to execute the above COBOL program −
When you compile and execute the above program, it produces the following result −
Character Strings
Character strings are formed by combining individual characters. A character string can be a
- Comment,
- Literal, or
- COBOL word.
All character strings must be ended with separators. A separator is used to separate character strings.
Frequently used separators − Space, Comma, Period, Apostrophe, Left/Right Parenthesis, and Quotation mark.
Comment
A comment is a character string that does not affect the execution of a program. It can be any combination of characters.
There are two types of comments −
Comment Line
A comment line can be written in any column. The compiler does not check a comment line for syntax and treats it for documentation.
Comment Entry
Comment entries are those that are included in the optional paragraphs of an Identification Division. They are written in Area B and programmers use it for reference.
The text highlighted in Bold are the commented entries in the following example −
JCL to execute above COBOL program −
When you compile and execute the above program, it produces the following result −
Literal
Literal is a constant that is directly hard-coded in a program. In the following example, 'Hello World' is a literal.
There are two types of literals as discussed below −
Alphanumeric Literal
Alphanumeric Literals are enclosed in quotes or apostrophe. Length can be up to 160 characters. An apostrophe or a quote can be a part of a literal only if it is paired. Starting and ending of the literal should be same, either apostrophe or quote.
Example
The following example shows valid and invalid Alphanumeric Literals −
Numeric Literal
A Numeric Literal is a combination of digits from 0 to 9, +, –, or decimal point. Length can be up to 18 characters. Sign cannot be the rightmost character. Decimal point should not appear at the end.
Windows xp software for pc. Example
![As400 As400](/uploads/1/2/6/0/126011608/335483848.png)
The following example shows valid and invalid Numeric Literals −
COBOL Word
COBOL Word is a character string that can be a reserved word or a user-defined word. Length can be up to 30 characters.
User-Defined
As400 Cobol Reference Manual Pdf
User-defined words are used for naming files, data, records, paragraph names, and sections. Alphabets, digits, and hyphens are allowed while forming userdefined words. You cannot use COBOL reserved words.
Reserved Words
As400 Cobol Reference Manual Template
Reserved words are predefined words in COBOL. Different types of reserved words that we use frequently are as follows −
- Keywords like ADD, ACCEPT, MOVE, etc.
- Special characters words like +, -, *, <, <=, etc
- Figurative constants are constant values like ZERO, SPACES, etc. All the constant values of figurative constants are mentioned in the following table.
Figurative Constants
As400 System User Manual
Sr.No. | Figurative Constants & Description |
---|---|
1 | HIGH-VALUES One or more characters which will be at the highest position in descending order. |
2 | LOW-VALUES One or more characters have zeros in binary representation. |
3 | ZERO/ZEROES One or more zero depending on the size of the variable. |
4 | SPACES One or more spaces. |
5 | QUOTES Single or double quotes. |
6 | ALL literal Fills the data-item with Literal. |