The COBOL2000 compiler identifies COBOL source files by the presence of one of the following standard file name extensions:
.cob
or .cbl
COBOL source files with file names not ending in a standard extension can still be compiled, as long as the file names are specified with the -k option (see section "General options").
Compilation units stored in BS2000 files or PLAM libraries cannot be processed by the compiler in the POSIX subsystem.
To transfer BS2000 files and PLAM library elements to the POSIX file system and back you can use the POSIX bs2cp
command.
The POSIX edt
command allows you to edit POSIX files at a BS2000 terminal.If the POSIX shell was accessed with rlogin, the POSIX command vi
is available for editing purposes. Refer to the “POSIX Commands” manual [29].
Input of program segments (COPY elements)
The format of the COPY statement for extracting COPY texts from POSIX files is as follows:
COPY text-name [IN/OF library-name]
text-name is the name of the POSIX file (without the directory components) containing the COPY text. The name may not contain lowercase letters.
library-name is the name of an environment variable containing one or more absolute path names of directories to search. The name may not contain lowercase letters.
If the IN/OF library-name argument is not included in the COPY statement, the compiler evaluates the contents of an environment variable named COBLIB.
Before the compiler is invoked, the environment variables must have been assigned the path names of the directories to search and exported with the POSIX export
command.
Example 14-2
COPY statements in the compilation unit:
... COPY TEXT1 IN COPYLNK COPY TEXT2 IN COPYLNK ...
Defining and exporting the environment variable in the POSIX shell:
export COPYLNK=/USERIDXY/copy1:/USERIDXY/copy2
The colon causes the COPYLNK environment variable to be initialized with the names of two directories to be searched for the POSIX files containing the COPY texts (TEXT1, TEXT2). The directory /USERIDXY/copy1 is first searched and then the directory /USERIDXY/copy2.