OPEN and OPENR (Open a File) Macro

The OPEN (or OPENR) macro activates all files.

Except for the code in the operation field, the format of the OPENR macro is the same as that of the OPEN macro.

When OPENR is specified, the symbolic address constants that are generated from the operands of the macro are self-relocating. When OPEN is specified, the symbolic address constants are not self-relocating. Throughout the manual the term OPEN also implies OPENR, unless stated otherwise.

OPEN need not be issued for DTFCN files in a non-self-relocating environment. However, self-relocating programs using LIOCS must specify OPENR for all files, including console files.

If OPEN attempts to activate a file whose device is unassigned, the job is terminated. If the device is assigned IGN, OPEN does not activate the file, but turns on bit 2 of the DTF byte 16 (counting from 0), which indicates that the file is not activated. If this bit is on after issuing an OPEN, I/O operations cannot be attempted for the file.

Format

Read syntax diagramSkip visual syntax diagramnameOPEN,filename( rn)

Requirements for the caller

AMODE:
24 or 31
RMODE:
24
ASC Mode:
Primary

Parameters

filename | (rn)
Code the symbolic name of the file (DTF filename) to be opened. You can open up to 16 files with one macro by coding additional file names. Alternatively, you can load the address of a file name into a register and specify the register, using ordinary register notation.

The high-order 8 bits of this register must be zeros. For OPENR, the address of the file 's name can be preloaded into any of the registers 2 through 12. For OPEN, this address can be preloaded into register 0 or any of the registers 2 through 12.