Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Program execution in the POSIX shell

A COBOL program developed and executed in the POSIX shell or in BS2000 can process POSIX files without any preparatory steps when compiling and linking (cf. program execution in BS2000).
It is not possible to process BS2000 files from the POSIX shell.

When processing POSIX files, the same functionality restrictions apply as for file processing in BS2000 (see section "Program execution in the BS2000 environment").

Assigning a POSIX file

A POSIX file is assigned using a shell environment variable named external-name. external-name is a file name from the program’s ASSIGN clause.
The environment variable must be initialized with the name of the POSIX file and exported using the POSIX export command.
The environment variable is initialized as follows:

external-name= {filename | relative-pathname | absolute-pathname}

filename identifies the requested POSIX file if it is in the current directory.

relative-pathname is the file name with the directory components as of the current directory.

absolute-pathname is the file name with all directory components including the root directory (beginning with /).

Example 14-8

COBOL compilation unit:

...
FILE-CONTROL.
SELECT AFILE ASSIGN TO "CUST1"
...

Linkage with the POSIX file cust1 before calling the program:

export CUST1=/USERIDXY/customers/cust1