

Process Command Language › Process Commands › CLOSE
CLOSE
The CLOSE command is a batch-only command that closes a dialog's input and/or output file maps. If an application terminates with files still open, the runtime system automatically closes the files.
Note: A CLOSE command closes a file logically only if other dialogs using different maps have accessed the same file. To close the file physically, a CLOSE command must be issued for each map.
The CLOSE command is required when you want to close a file before the application terminates, as in the following cases:
- The application has been reading from or writing to a file and is required to start over at the beginning of the file.
- An output file to which records were written is to be read as an input file.
- A run-unit commit is to be performed by a COMMIT command or at the end of a run unit. If a COMMIT command is issued, but not all files used in the application are closed, the runtime system either takes no action, sends a warning message to the log, or abends the application, as specified at system generation and/or at runtime. The default action is abend.
Syntax for the CLOSE command is shown below:
►►── CLOSE ─────┬─ BOTH ◄ ──┬─── file MAPs ──── . ─────────────────────────────►◄
├─ INPUT ───┤
└─ OUTPUT ──┘
- CLOSE BOTH/INPUT/OUTPUT FILE MAPS
-
Specifies the file map to be closed, as follows:
- BOTH (default) specifies the dialog's input and output file maps. BOTH can be specified even if the dialog has only an input or an output file map.
- INPUT specifies the dialog's input file map.
- OUTPUT specifies the dialog's output file map.
Copyright © 2013 CA.
All rights reserved.
 
|
|