This statement compiles one or more source programs and generates a module for each compilation unit.
COMPILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
SOURCE =
This option specifies one or more source programs to be compiled.
A source program can be read from the system file SYSDTA, a cataloged BS2000 file, a PLAM library or a POSIX file.
Note that if the source program is entered from SYSDTA, only one source program can be read per COMPILE statement.
SOURCE = *SYSDTA
Input from the system file SYSDTA is only possible in the C modes and in the Cfront C++ mode of the compiler. In the modes C++ V3, C++ 2017 and C++ 2020 the value *SYSDTA is rejected with a corresponding error message. SYSDTA is assigned to the terminal in interactive mode but can be reassigned to a cataloged file or a PLAM library element with the ASSIGN-SYSDTA command (see also "Notes on input via SYSDTA").
SOURCE = <filename 1..54>
<filename> is the name of a cataloged BS2000 file.
SOURCE = <posix-pathname>
Only a file name is permitted as <posix-pathname>. See "Compiler I/O in the POSIX file system" for a description of the term <posix-pathname>.
SOURCE = *LIBRARY-ELEMENT(...)
This option is used to specify a PLAM library and an element in it.
LIBRARY = <filename 1..54>
<filename> assigns the name of a PLAM library.
LIBRARY = *LINK(...)
LINK-NAME = <filename 1..8>
<filename> is used to specify a link name for a PLAM library. The link name must already have been assigned to the library name with the ADD-FILE-LINK command before the compiler is called.
ELEMENT = <composed-name 1..64 with-under>(...)
<composed-name> identifies the fully-qualified name of an element from the PLAM library specified earlier. The element must be of type S.
VERSION = *HIGHEST-EXISTING
If the element specification contains no version ID, the compiler uses the element with the highest existing version.
VERSION = <composed-name 1..24 with-under>
The compiler uses the element with the specified version.
MODULE-OUTPUT =
This option allows the user to control the library and/or name under which the generated modules are stored.
MODULE-OUTPUT = *SOURCE-LOCATION
The module is written to the same location as the source program. If the source program is a PLAM library element, the module is placed in the library of the source program. If the source program is a POSIX file, the module is written as an object file (“.o” file) into the directory of the source program.
The element or object file name is derived from the name of the source program (see section “Rules for constructing module names”).
The module cannot be written to a write-only
file. In Posix, it must always be possible to read the library or object file.
The *SOURCE-LOCATION specification is invalid if the source program is read from acataloged BS2000 file or via SYSDTA (see "Notes on input via SYSDTA").
MODULE-OUTPUT = <posix-pathname>
The module is written as an LLM object file in the POSIX file system.
Both a file name and a directory are permitted as <posix-pathname>. See "Compiler I/O in the POSIX file system" for a description of the term <posix-pathname>.
When a file name is specified, the object file is stored under this name. Specification of a file name is illegel when compiling multiple source programs with one COMPILE statement.
When a directory name dir is specified, an object file for each compiled source program is written under the default name sourcefile.o to the directory dir (see also section “Rules for constructing module names”).
The directories specified with <posix-pathname> must already exist.
When constructing file names, it must be noted that object files can only be meaningfully processed further (i.e. linked) in the POSIX subsystem if the name contains the suffix .o
or a suffix defined with the -Y F
option of the cc
/c11
/c89
/CC
commands (see also the manual “POSIX Commands of the C/C++ Compiler” [1]).
MODULE-OUTPUT = *LIBRARY-ELEMENT(...)
This option specifies the PLAM library (LIBRARY=) and the element name(ELEMENT=) under which the module is to be stored.
LIBRARY = *STD-LIBRARY
Modules are stored in the library SYS.PROG.LIB by default.
LIBRARY = *SOURCE-LIBRARY
The module is written to the PLAM library which contains the source program.
The *SOURCE-LIBRARY specification is invalid if the source program is read from a cataloged BS2000 file, a POSIX file or via SYSDTA.
LIBRARY =<filename 1..54>
The module is written to a PLAM library with the specified name.
LIBRARY = *LINK(...)
LINK-NAME = <filename 1..8>
<filename> can be used (instead of a cataloged library name) to specify a valid link name for the library. The link name must already have been assigned to the library name with the ADD-FILE-LINK command before the compiler is called.
ELEMENT = *STD-ELEMENT(...)
The element name is derived from the name of the source program (see section “Rules for constructing module names”).
VERSION = *UPPER-LIMIT
If the element entry does not contain a version ID, the highest possible version is used by the compiler.
VERSION = *INCREMENT
The element is assigned a version number that is obtained by incrementing the highest existing version number by 1, assuming that the highest existing version ID ends with a digit that can be incremented. If the version ID cannot be incremented, the compiler run is aborted with an error message.
Warning: You may not specify *INCREMENT in the modes C++ V3, C++ 2017 and C++ 2020.
Example
Highest existing version | Version generated by *INCREMENT |
ABC1 | ABC2 |
VERSION = <composed-name 1..24 with-under>
The element is assigned the specified version.
ELEMENT = <composed-name 1..64 with-under>(...)
The module is written under the assigned name to the PLAM library specified with LIBRARY= . This specification is invalid when compiling multiple source programs with one COMPILE statement.
To enable further processing with DBL, element names of LLMs must not exceed a maximum of 32 characters (see section “Rules for constructing module names”).
VERSION = *UPPER-LIMIT / *INCREMENT /
<composed-name 1..24 with-under>
The version can be specified as described above for
ELEMENT=*STD-ELEMENT(...).
Warning: You may not specify *INCREMENT in the modes C++ V3, C++ 2017 and C++ 2020.