CLOSE and CLOSER (Close a File) Macro

The format of the CLOSER macro is the same as that of the CLOSE macro, except that you code CLOSER instead of CLOSE in the operation field.

When CLOSER is specified, the symbolic address constants that CLOSER generates from the parameter list are self-relocating. When CLOSE is specified, the symbolic address constants are not self-relocating. Throughout the manual the term CLOSE also implies CLOSER, unless stated otherwise.

The CLOSE or CLOSER macro is used to deactivate previously opened files; it ends the association between a logical file declared in a program and a specific physical file on an I/O device. Issuing a CLOSE or CLOSER macro for a file ensures that the system properly ends processing for the specified files.

A file can be closed at any time, with the following exceptions:
  • Console files must not be closed; the CLOSE(R) macro is invalid for files defined with the DTFCN.
  • A file cannot be closed from within an ERROPT routine.

If issued for a 4248 printer file making use of the horizontal copy function, the macro causes horizontal printing to be turned off.

If CLOSE or CLOSER is issued to an unopened tape input file, the option specified in the DTF rewind option is performed. If CLOSE or CLOSER is issued to an unopened tape output file, no tapemark or labels are written.

No further requests can be issued for the closed file until it is reopened.

Format

Read syntax diagramSkip visual syntax diagramnameCLOSECLOSER,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 closed. You can close 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 CLOSER, the address of the file's name can be preloaded into any of the registers 2 through 12. For CLOSE, this address can be preloaded into register 0 or any of the registers 2 through 12.