COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-121
SOURCE
A SOURCE 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.
•
SOURCE Directive Behavior in IF/IFNOT/ENDIF Sequences
The compiler ignores a SOURCE directive specified within conditional text (within
the scope of an IF or IFNOT directive) if the controlling condition is false.
•
Interaction of SOURCE and COLUMNS Directives
When a COLUMNS directive applies to the line or lines containing a SOURCE
directive, the same logical line length attribute is the default for the lines introduced
in response to that directive; however, a COLUMNS directive appearing within the
designated file overrides the default. In this circumstance, the compiler honors the
“inner” logical line length for the remainder of the text imported by the SOURCE
directive, after which the “outer” logical line length becomes active again.
•
Effect of ANSI and TANDEM Format Specifying Directives
The source text format (ANSI or Tandem) which applies to the line or lines
containing a SOURCE directive is the default for the lines introduced in response
to that directive; however, ANSI or TANDEM directives appearing within lines read
from the file (or ANSI or TANDEM options specified in SECTION directives) take
effect when encountered. These then apply to subsequent lines until they are
overridden, the end of the source file is reached, or the end of a selected section is
reached (which causes the compiler to revert to the default source format before it
resumes reading the next selected section). In all cases the “outer” source format
attribute becomes active again after processing of the SOURCE directive
completes.
•
Diagnostic Messages and SOURCE Directives
If the compiler cannot at least minimally process a SOURCE directive (because the
edit-file-name specified is invalid, or the file cannot be accessed, or the file is not
an EDIT file, and so forth), the compilation terminates.
If the compiler is unable to access a section specified in the SOURCE directive
(because the section-name is invalid or the section is not in the file) the compiler
issues a diagnostic message, but does not terminate the compilation.
•
Format of a Source Library
A source library has the same format as a COPY library; in fact, the only difference
between a source library and a COPY library is context—a source library is
referenced by a SOURCE directive and a COPY library is referenced by a COPY
statement. For the syntax of a source library, see Library Format.