Derivation: Open Close STATUS
OCSTATUS controls the verification of file existence and whether
a file is deleted based on the STATUS specifier on the OPEN and CLOSE
statement, respectively.
- Non-CICS default
- OCSTATUS=((ON),OVR)
- CICS® default
- OCSTATUS is ignored under CICS.
Syntax
.-ON--. .-OVR----.
>>-OCSTATUS--=--(--(--+-OFF-+--)--,--+-NONOVR-+--)-------------><
- ON
- Specifies that file existence is checked with each OPEN statement
to verify that the status of the file is consistent with STATUS='OLD'
and STATUS='NEW'. It also specifies that file deletion occurs with
each CLOSE statement with STATUS='DELETE' for those devices which
support file deletion. Preconnected files are included in these verifications.
OCSTATUS consistency checking applies to DASD files, PDS members,
VSAM files, MVS™ labeled tape
files, and dummy files only. For dummy files, the consistency checking
occurs only if the file was previously opened successfully in the
current program.
In addition, when a preconnected file is disconnected
by a CLOSE statement, an OPEN statement is required to reconnect the
file under OCSTATUS. Following the CLOSE statement, the INQUIRE statement
parameter OPENED indicates that the unit is disconnected.
- OFF
- Bypasses file existence checking with each OPEN statement and
bypasses file deletion with each CLOSE statement.
If STATUS='NEW',
a new file is created; if STATUS='OLD', the existing file is connected.
If
STATUS='UNKNOWN' or 'SCRATCH', and the file exists, it is connected;
if the file does not exist, a new file is created.
In addition,
when a preconnected file is disconnected by a CLOSE statement, an
OPEN statement is not required to reestablish the connection
under OCSTATUS(OFF). A sequential READ, WRITE, BACKSPACE, REWIND,
or ENDFILE will reconnect the file to a unit. Before the file is reconnected,
the INQUIRE statement parameter OPENED will indicate that the unit
is disconnected; after the connection is reestablished, the INQUIRE
statement parameter OPENED will indicate that the unit is connected.
- OVR
- Specifies that the option can be overridden.
- NONOVR
- Specifies that the option cannot be overridden.