COBOL PROGRAMMING
1) Introduction Cobol
1) Introduction Cobol
- In 1959, the new language named COBOL (COmmon Business Oriented Language) was introduced keeping in mind the business purpose applications.
- The first COBOL compiler became available in early 1962.
- The next version with some new additions was published in 1965.
- In August 1968 a standard version of the language was approved by the American National Standard Institute (ANSI).
- This standard version was again modified in 1974 and is known as ANSI-74 COBOL or COBOL -74.
- The revision process has been continuous and in 1985 a revised standard was introduced. This standard was known as COBOL-85.
2) FORMAT FOR COBOL PROGRAMS
- COBOL is a high-level language.
- Hence, a COBOL program can be executed on a computer for which a COBOL compiler is available.
- The compiler translates a COBOL source program into the machine language object program.
- This object program is really executed.
- COBOL programs are written in coding sheets.
- There are 80 columns in a line of the coding sheet.
- The page number is coded in columns 1-3 and the line numbers are coded in columns 4-6.
- The page and line numbers together is called the sequence number.
- Depending on the type, the entries are coded both from column 8 or column 12 and in both cases it can be continued up to column 72.
- Columns 73-80 can be used to write some identification.
- The compiler ignores anything that is given in columns 73-80 except when a printed copy of the program is provided by the compiler in which case the entries in columns 73-80 are also listed.
- The use of the sequence number is also optional and can be omitted.
- However, when sequence numbers are provided they must appear in ascending order.
- In COBOL there are two types of entries known as margin A and margin B entries.
- Margin A entries start from column 8, 9, 10 or 11 and margin B entries start from column 12 or anywhere after 12.
- An asterisk (*) in column 7 indicates a comment line and the entry is not compiled to produce object code.
- Comment lines are actually some notes revealing the intentions of the programmer.
- Since the compiler ignores them, anything can be included as comments.
- Comment lines can appear anywhere after the first line of the COBOL program.
- A comment line can also be indicated by using the character slash ( / ) in column 7.
- But in this case the comment line will be printed after causing a page ejection (i.e., after skipping to the top of the next page).
No comments:
Post a Comment