COBOL Sequence Numbers
A COBOL sequence number can be placed at the beginning of any embedded SQL statement. For example:
000100 EXEC SQL DROP TABLE emp END-EXEC.
In most instances, the preprocessor outputs any COBOL sequence number that precedes an embedded SQL statement. However, in a few cases the preprocessor ignores a COBOL sequence number and does not include it in the code it generates. For example, sequence numbers occurring on embedded SQL statements that produce no COBOL code are ignored by the preprocessor. A sequence number on a continuation line for an embedded SQL statement or a declaration will be ignored.
The preprocessor never generates sequence numbers of its own. Thus, if you prefix an embedded SQL statement with a sequence number and that statement is translated by the preprocessor into several COBOL statements, the sequence number will appear before the first COBOL statement only. Subsequent COBOL statements will contain blanks in the sequence area.
A sequence number may contain any valid character in the character set. Also, it must be placed in the sequence area of a line. The sequence area ranges from Columns 1 to 6.
Embedded SQL statements in include files may also contain COBOL sequence numbers. Include files will generate sequence numbers in the same manner as outlined above.
VMS:
COBOL sequence numbers can only be used in programs coded in ANSI format, which requires the
-a flag on the preprocessor command line.
Last modified date: 08/28/2024