Relative record data set (RRDS)
EXEC CICS DELETE FILE ( ) [ SYsid ( ) ]
[ Sysid( ) ]
[ RIdfld( ) [ Keylength( ) [ Generic [ Numrec( ) ] ] ] ] [ Token( ) ]
[ RBa | RRn ] END-EXEC
Delete a record from a file -- VSAM KSDS or VSAM RRDS.
EXEC CICS DELETE FILE('MASTVSAM') RIDFLD(ACCTNO) NUMREC(NUMDEL) END-EXEC
Example 1: It shows you how to delete
a group of records in a VSAM data set: Example 2:
PROCEDURE DIVISION. MOVE 111 TO WS-KEY EXEC CICS DELETE
FILE (‘FL001’) RIDFLD (WS-KEY) END-EXEC
Notes:
DELETE deletes a record from a file on a KSDS, a path over a KSDS, a CICS or user-maintained data table, or an RRDS. You cannot delete from a VSAM ESDS or a BDAM file. All references to KSDS apply equally to CICS maintained data tables and, except where stated otherwise, to paths over a KSDS. The file may be on a local or a remote system. You identify, in the RIDFLD option, the specific record to be deleted.
You can delete a group of records in a similar way with a single invocation of this command, identifying the group by the GENERIC option (not available for RRDS).
You can also use this command to delete a single record that has previously been retrieved for update (by a READ UPDATE command). In this case, you must not specify the RIDFLD option.
When this command is used to delete records from a CICS-maintained data table, the update is made to both the source VSAM KSDS data set and the in-memory data table.
When this command is used to delete records from a user-maintained data table, the update is made only to the in-memory data table.
When this command is used to delete records from a coupling facility data table, the update is made only to the data table in the coupling facility.
Options
FILE(filename)
specifies the name of the file to be accessed. If SYSID is specified, the data set to which this file refers is assumed to be on a remote system irrespective of whether the name is defined in the FCT. Otherwise, the FCT entry is used to find out whether the data set is on a local or a remote system.
GENERIC (VSAM KSDS only)
specifies that the search key is a generic key with a length specified in the KEYLENGTH option. The search for a record is satisfied when a record is found with a key that has the same starting characters (generic key) as those specified.
KEYLENGTH(data-value)
specifies the length (halfword binary) of the key that has been specified in the RIDFLD option, except when RBA or RRN is specified, in which case it is not valid. This option must be specified if GENERIC is specified, and it may be specified whenever a key is specified. However, if the length specified is different from the length defined for the data set and the operation is not generic, the INVREQ condition occurs. The INVREQ condition also occurs if you specify GENERIC, and the KEYLENGTH is not less than that specified in the VSAM definition.
You should not specify a zero value of KEYLENGTH because the results of this are unpredictable. For remote files, the KEYLENGTH can be specified in the FILE definition. If KEYLENGTH is not defined there, and is not specified in the application program, and the key is longer than 4 characters, the default value is 4.
NOSUSPEND (RLS only)
specifies that the request is not to wait if VSAM is holding an active lock against the record, including records locked as the result of a DEADLOCK.
NUMREC(data-area) (VSAM KSDS only)
specifies a halfword binary data area that CICS sets to the number of deleted records.
RBA
(VSAM KSDS base data sets only, not paths) specifies that the record identification field specified in the RIDFLD option contains a relative byte address. This option should be used only when deleting records using relative byte addresses instead of keys to identify the records. You cannot use RBA for:
User-maintained data tables Coupling facility data tables
Any files opened in RLS access mode
RIDFLD(data-area)
specifies the record identification field. The contents can be a key, a relative byte address, or a relative record number. For a relative byte address or a relative record number, the format of this field must be fullword binary. For a relative byte address, the RIDFLD can be greater than or equal to zero. For a relative record number, the RIDFLD can be greater than or equal to 1. The contents must be a key for user-maintained data tables or coupling facility data tables.
You must specify this option if you have also specified GENERIC.
RRN (VSAM RRDS only)
specifies that the record identification field specified in the RIDFLD option contains a relative record number. This option should be used only with files referencing relative record data sets.
SYSID(systemname)
specifies the name (1-4 characters) of the system the request is directed to. If you specify SYSID, and omit both RBA and RRN, you must also specify KEYLENGTH; it cannot be found in the FCT.
TOKEN(data-area)
Specifies, as a fullword binary value, a unique identifier for this DELETE request. Use this to associate the delete request with a record returned on a previous READ UPDATE or BROWSE for UPDATE request. The value to use is the value returned in the TOKEN held by the earlier READ UPDATE or BROWSE for UPDATE request. TOKEN can be function shipped. However, if a request specifying TOKEN is function shipped to a member of the CICS family of products that does not recognize this option, the request fails.
WRITE
EXEC CICS WRITE FILE ( )