Reset Reusable Files

When REUSE=YES Invokes Reset Function

Specifying
REUSE=
YES
in a file's
DBVUFIL
macro in the batch VSAM Interface Table (VIT) is analogous to specifying the
reusable
attribute in the file's catalog entry in native VSAM.
REUSE=
YES
indicates that the file is a reusable file and may be reset at any OPEN request, depending on the current
MACRF=
parameter settings in the file's ACB. Specifying
REUSE=
NO
in the file's
DBVUFIL
macro indicates that the file is not reusable. Therefore, regardless of how the ACB is coded, the Transparency does not invoke the deletion of records at any OPEN request.
REUSE=
YES
establishes that the current file is potentially reusable. Under the Transparency, invocation of the processing option, reset, depends on the current ACB settings. If the file is designated as updatable by using
MACRF=
OUT
and if a reset is requested by using
MACRF=
RST
, then the Transparency issues requests to delete all records in the converted table on interception of the OPEN request. If the file is not designated as updatable (if OUT is not specified in the ACB), or if reset is not requested (if
MACRF=
NRS
is specified in the ACB), the Transparency will not delete records at open time even though
REUSE=YES
is specified in the VIT.
In summary,
Datacom VSAM Transparency
emulates the reset operation on a reusable file only when the following prerequisites are met:
  • VIT requirement: The
    DBVUFIL
    macro for the file specifies
    REUSE=
    YES
    . See
    REUSE=
    in Processing Reusable Files with and without Reset.
  • ACB requirement: The
    MACRF=
    parameter in the file's ACB specifies RST and OUT, the options which invoke reset and allow updates.

How the Transparency Emulates a Reset

Datacom VSAM Transparency
emulates native VSAM's reset operation by deleting all records from the converted table on interception of any OPEN request to the corresponding file. It implements the deletion process using a
Datacom/DB
internal interface, which avoids the overhead of reading each record for update before deletion by accessing sequential record IDs from the Index Area (IXX).

Processing Reusable Files with and without Reset

Reusable files are generally work files. Resetting a reusable file prepares it for load mode, ready to receive new data that replaces the obsolete data that was deleted. Generally, the program that adds the new records begins by requesting that the current contents be reset (deleted). Other programs may read that file sequentially. These programs would not request reset.
When OPEN OUTPUT is specified for an INDEXED file (VSAM), most COBOL compilers check that the file is empty. The COBOL code indicates an OPEN error if a nonzero value is found in the ENDRBA field (ARDHRBA).
During
Datacom VSAM Transparency
processing of an OPEN request, the ENDRBA is set to a constant value for files specifying REUSE=NO and to zero for files specifying
REUSE=
YES
. You must therefore code
REUSE=
YES
for COBOL applications that open
Datacom VSAM Transparency
files as OUTPUT, even if a
Datacom/DB
Utility (DBUTLTY) null area load was previously performed.
In native VSAM, a reusable base cluster cannot have alternate indexes. VSAM Transparency does not enforce this restriction. If you define a path as reusable,
Datacom VSAM Transparency
invokes the reset function when using the key for that path if other prerequisites are met.

Implementation of Transaction Backout

If using a transaction backout on a reusable file which has been reset, only the added records are removed if the program abends. The file is backed out to an empty state rather than reloaded to the start of task condition. This occurs because the Transparency issues a
Datacom/DB
checkpoint after the reset process has completed, except when the subsystem parameter
CLOSE=
DEFER
is specified.

Effect of Null Area Load on Reset and Blocked GETIT Processing

If you insert a job step to do a null area load before executing the
Datacom VSAM Transparency
job step to open a reusable file, the Transparency-invoked reset is accomplished almost instantaneously. If the table is large, clearing it using a Transparency-invoked reset alone takes longer than clearing the area using a null load followed by the Transparency's attempt to reset the empty table. If you have specified
GETIT=
NO
in the file's
DBVUFIL
macro in the VIT, resetting using a null area load only has advantages if the table resides in an area with no other tables.
Datacom/DB
Utility (DBUTLTY) null area load clears every
Datacom/DB
table in the area. Therefore, if other tables reside in the area with the reusable table, allow
Datacom VSAM Transparency
to implement the reset without a prior null area load.

Reset Operations from CICS Applications

The reset operation is not emulated by
Datacom VSAM Transparency
for CICS applications. The
EMPTY
parameter of the command-level commands
EXEC CICS SET OPEN
or
EXEC CICS SET CLOSE
is not supported.