Source Code Format
The following sections discuss source code formatting considerations for Windows, UNIX, and VMS.
Format Considerations--Windows and UNIX
The preprocessor produces Micro Focus COBOL source code in ANSI format.
You must place all string continuation indicators ( - ) in column 7. Comment indicators ( * ) may be in column 1 or column 7. For details on comments and continued string literals, see
Embedded SQL Statement Syntax for COBOL in this chapter.
The preprocessor generates code using certain conventions. Indicators for comments and continued string literals are placed in column 7. The 01 level number for data declarations known to the preprocessor and any optional labels before embedded SQL statements are output in Area A, starting at column 8. All other embedded SQL statements are placed in Area B, starting at column 12. No statements generated extend beyond column 72. COBOL statements and declarations unknown to the preprocessor appear in the preprocessor output file unchanged from the input file.
The preprocessor does not generate any code in columns 1-6 (the Sequence Area). Do not, however, precede embedded SQL statements with sequence numbers—only the white space of a label can precede the exec keyword. Also, although the preprocessor never generates code beyond column 72 no matter which format is used, it does accept code in columns 73 - 80. Therefore, anything placed in that area on an embedded SQL line must be valid embedded SQL code.
Format Considerations--VMS
The preprocessor can produce source code written in either VAX COBOL terminal format or ANSI format. The default is terminal format; if you require ANSI format, use the -a flag on the preprocessor command line. The COBOL code that the preprocessor generates for embedded SQL statements will follow the format convention you have chosen.
In order to specify the -a flag, you must place all comment and string continuation indicators (* and -) in column 7. If you do not intend to use the -a flag, those indicators must instead be located in column 1. For details on comments and continued string literals, see
Embedded SQL Statement Syntax for COBOL in this chapter.
When the -a flag is specified, the preprocessor generates code using certain conventions. Indicators for comments and continued string literals are placed in column 7. The 01 level number for data declarations known to the preprocessor and any optional labels before embedded SQL statements are output in Area A, starting at column 8. All other embedded SQL statements are placed in Area B, starting at column 12. No statements generated extend beyond column 72. COBOL statements and declarations unknown to the preprocessor appear in the preprocessor output file unchanged from the input file.
The preprocessor may generate sequence numbers in columns 1 - 6 (the Sequence Area). For information on sequence numbers, see
COBOL Sequence Numbers in this chapter. Also, although the preprocessor never generates code beyond column 72 no matter which format is used, it does accept code in columns 73 - 80. Therefore, anything placed in that area on an embedded SQL line must be valid embedded SQL code.
Last modified date: 08/28/2024