



A COBOL source program is a syntactically correct set of COBOL statements.
Following is the format for the entries and statements that constitute a separately-compiled COBOL source program.
___ Format--COBOL Source Program _____________________________________________
| |
| (1) |
| >>__ _IDENTIFICATION_ __DIVISION.__PROGRAM-ID._____program-name-1__________> |
| |_ ID ___________| |
| |
| (1) |
| >__ ______________________________________ __._____________________________> |
| |_ ____ __ _ RECURSIVE _ __ _________ _| |
| |_IS_| |_INITIAL_____| |_PROGRAM_| |
| |
| >__ _________________________________ _____________________________________> |
| |_identification-division-content_| |
| |
| >__ _____________________________________________________ _________________> |
| |_ENVIRONMENT DIVISION.__environment-division-content_| |
| |
| >__ _______________________________________ _______________________________> |
| |_DATA DIVISION.__data-division-content_| |
| |
| >__ _________________________________________________ _____________________> |
| |_PROCEDURE DIVISION.__procedure-division-content_| |
| |
| >__ _________________________________________________________________ ____>< |
| |_ _______________________________ __END PROGRAM__program-name-1._| |
| | <___________________________ | |
| |___| nested source program |_|_| |
| |
| nested source program: |
| (1) |
| |__ _IDENTIFICATION_ __DIVISION.__PROGRAM-ID._____program-name-2___________> |
| |_ ID ___________| |
| |
| (1) |
| >__ ______________________________________________ __._____________________> |
| |_ ____ __ _COMMON__ _________ _ __ _________ _| |
| |_IS_| | |_INITIAL_| | |_PROGRAM_| |
| |_INITIAL__ ________ _| |
| |_COMMON_| |
| |
| >__ _________________________________ _____________________________________> |
| |_identification-division-content_| |
| |
| >__ _____________________________________________________ _________________> |
| |_ENVIRONMENT DIVISION.__environment-division-content_| |
| |
| >__ _______________________________________ _______________________________> |
| |_DATA DIVISION.__data-division-content_| |
| |
| >__ _________________________________________________ _____________________> |
| |_PROCEDURE DIVISION.__procedure-division-content_| |
| |
| >__ _______________________________ __END PROGRAM__program-name-2._________| |
| | <___________________________ | |
| |___| nested source program |_|_| |
| |
| Note: |
X | (1) This separator period is optional as an IBM extension. |
| |
|______________________________________________________________________________|
A sequence of separate COBOL programs can also be input to the compiler.
Following is the format for the entries and statements that constitute a
sequence of source programs (batch compile).
___ Format--Sequence of COBOL Source Programs __________________________
| |
| <______________________ |
| >>____COBOL-source-program_|________________________________________>< |
| |
|________________________________________________________________________|
An end program header is optional for the last program in the sequence only if that program does not contain any nested-source-programs.
Subtopics:
© Copyright IBM Corp. 1991, 1998
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.