OPEN

Initiates the processing of a file. It also performs checking and writing of labels and other I/O operations.

Opcode Operation File Types
00 OPEN INPUT L S R I
01 OPEN OUTPUT L S R I
02 OPEN I-O L S R I
03 OPEN EXTEND L S R I
04 OPEN INPUT WITH NO REWIND L S
05 OPEN OUTPUT WITH NO REWIND L S
08 OPEN INPUT REVERSED L S
Input Fields
Filename area
Key definition block
fcd-organization File organization
fcd-access-mode Access mode
fcd-open-mode Open mode
fcd-name-length Length of filename
fcd-lock-mode Lock mode flags
fcd-other-flags Other flags
fcd-file-format File format
fcd-max-rec-length Maximum record length
fcd-recording-mode Recording mode
fcd-min-rec-length Minimum record length
fcd-filename-address Pointer to the filename area
fcd-key-def-address Pointer to the key definition block (I)
fcd-data-compress Data compression
fcd-locktypes Type of file locks
Output Fields
fcd-file status File status
fcd-open-mode Open mode
fcd-handle Pointer to the file; use for all subsequent accesses to this file
Comments

You must have set up a key definition block for this file if it is an indexed file.

You can assign several FCDs to the same physical file and have them all open at the same time. The operating system counts it as just one open file. The physical file is not closed until every logical file assigned to it has been closed.