COBOL Manual for TNS and TNS/R Programs
Source Text Manipulation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
10-13
Library Format
Usage Considerations:
•
COLUMNS Directive
The library can contain at most one COLUMNS directive. The COLUMNS directive
must precede all SECTION directives and must appear alone in its compiler
directive line. Furthermore, the line’s question mark must always be in column 1
(even if the ANSI source text format applies).
•
SECTION Directive
Each SECTION directive must appear alone in a compiler directive line and the
line’s question mark must always be in column 1 (even if the ANSI source text
format applies). Each SECTION directive demarcates an individual text unrelated
to any other contents of the source library.
A SECTION directive cannot appear anywhere in the text of a COPY statement
(between the word COPY and its terminating period in the input stream) or a
REPLACE statement (between the word REPLACE and its terminating period in
the input stream); however, the compiler detects and reports its appearance within
pseudo-text only if that pseudo-text is introduced into the source as the result of
expanding the COPY statement or by the editing effects of the REPLACE
statement.
During program compilation, the compiler identifies a section by locating the
SECTION directive whose text-name matches the text-name specified in the
COPY statement. For more information, see SECTION.
•
Copying Sections of Text
The compiler copies text starting at the line after the SECTION directive line and
continues until it recognizes another SECTION directive or reaches the end of the
file.
•
No COPY Statements in COPY Library Sections
The COPY statement cannot be within a section of a COPY library.
•
Reference Format
The compiler assumes that the reference format of the library text is the same as
that of the line containing the COPY statement, unless you specify a different
format in the SECTION directive. (For information on Tandem format, see
Reference Format for Source Program Lines. For information on ANSI format, see
Section 16, ANSI Reference Format.)
If you specify a reference format in a SECTION directive, that format is active only
during execution of the COPY statement. After the compiler copies a section, it
uses the reference format previously active.
•
Compiler Directives in a COPY Library
Source text in a COPY library can contain compiler directives, which the compiler
obeys when it analyzes the copied text.