COBOL Manual for TNS and TNS/R Programs
Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
22-18
Specifying the Default COPY Library
Use the TACL command FILES to detect ZZBInnnn or ZZNCnnnn files and the TACL
command PURGE to purge the unwanted ones.
Specifying the Default COPY Library
The default COPY library is the library from which COPY statements read text when no
library name is specified in the COPY statement. If you do not specify the default
COPY library (as in the compilation examples in the preceding topic), then COPYLIB is
the default COPY library. To specify a different default COPY library, such as COPLIB2,
include its name in the compilation command:
89> COBOL85 /IN XYZ, OUT $SPX/ XYZOBJ, COPLIB2
89> NMCOBOL /IN XYZ, OUT $SPX/ XYZOBJ, COPLIB2
For more information about COPY libraries, see Using COPY and SOURCE Libraries.
Specifying Compiler Directives
Compiler directives can be included in the source program or specified in the
compilation command. To specify compiler directives (such as NOFIPS and NOWARN)
in the compilation command, put them at the end of the compilation command, as in
this example (note the semicolons):
90> COBOL85 /IN XYZ, OUT $SPX/ XYZOBJ, COPLIB2;NOFIPS;NOWARN
90> NMCOBOL /IN XYZ, OUT $SPX/ XYZOBJ, COPLIB2;NOFIPS;NOWARN
Compiler directives specified in this way are considered to be on line zero of the
source program. Most of them stay active until the compiler encounters a conflicting
directive later in the source program, but it depends on the directive. For information
about specific directives, see Compiler Directives.
Directives for Syntax Checking Only
If you compile your program with the SYNTAX directive, the compiler only checks its
syntax and does not generate object code. Because the compiler does not generate
object code, it runs much faster (but only if there are no errors).
90> COBOL85 /IN XYZ, OUT $SPX/ XYZOBJ, COPLIB2; SYNTAX
90> NMCOBOL /IN XYZ, OUT $SPX/ XYZOBJ, COPLIB2; SYNTAX
Another way to find syntax errors in your program is with the FIXERRS macro, which
requires that you compile your program with the ERRORFILE directive. For more
information about the FIXERRS macro, see FIXERRS Macro. For more information
about the ERRORFILE directive, see ERRORFILE.