COBOL Manual for TNS/E Programs (H06.03+)

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS/E Programs520347-003
22-16
Specifying the Default COPY Library
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> ECOBOL /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> ECOBOL /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> ECOBOL /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
.
Specifying Subvolumes to Be Searched for Unqualified Files
In your HP COBOL source program, an unqualified file is a file whose name does not
contain a volume and subvolume. It can be a source file (as in a COPY statement) or
an object file (as in an ENTER statement).
Two DEFINEs allow you to specify one or more subvolumes for the compiler to search
for unqualified files:
=_SOURCE_SEARCH (for unqualified source files)
=_OBJECT_SEARCH (for unqualified object files)