Clears a file buffer and opens a file for reading and writing.
F-OPEN file-buffer {DICT} file-name{,data-section-name}
error-cmd-line
F-O file-buffer {DICT} file-name{,data-section-name}
error-cmd-line
file-buffer is the number (1 to 9) of the file buffer with which the file is to be associated.
DICT specifies the dictionary section of file-name, if required.
file-name is the name of the file to be opened. Can be a literal (not enclosed in quotes), or a direct or indirect reference to a buffer or select register.
data-section-name specifies an alternative data section of file-name.
error-cmd-line is the line immediately after the F-OPEN command. Only executed if the specified file cannot be opened.
If the file cannot be opened, the line immediately after the F-OPEN command will be executed. If the file is opened successfully, this line will be ignored.
File buffers are maintained when control is transferred between jCL programs.
The file will remain open until closed (see the F-KLOSE command) or until the end of the program.
001 PQN
002 F-OPEN 1 SALES
003 X ERROR: Can"t find the Sales File!
004 T C, (5,10), "Welcome to...",+
.
.
If the SALES file is opened, execution continues with line 004. Otherwise, the program terminates with an appropriate error message.
JCL