Hour 2Writing Your First Program in COBOL

In Hour 1, “Getting Started,” you learned about the history of COBOL. You also installed and tested the compiler. In this hour, you learn the basic layout of a COBOL program and write your first program. This hour covers the following basics:

• The divisions of a COBOL program

• How to key a simple program into the editor

• Compiling, linking, and running your program

• What to do when the program won't compile

COBOL Program Layout

The layout, or format, of a COBOL program follows certain simple rules, which originated long ago when programs were punched onto 80-column punch cards. With COBOL, columns 1–6 are reserved for line numbering. Line numbers are not mandatory, nor do they have to be in sequence. ...

Get Sams Teach Yourself COBOL in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.