CICS FILE DELETE

CICS File Handling CICS FILE READ


Advertisements


Delete a record from a file.

The file can be VSAM KSDS, VSAM RRDS and data tables only.

The DELETE command deletes a record from a file on a KSDS.

The DELETE command can also deletes the records from data table, or an RRDS.

The DELETE cannot delete from a VSAM ESDS or a BDAM file.

The file used to perform operation can be on a local or a remote system.

The RIDFLD option specifies the specific record to be deleted.

If the record is locked for UPDATE, then it is not required to pro-vide RIDFLD.

Group of records can be deleted with a single invocation command with the GENERIC option.

GENERIC option is not available for RRDS.

If the GENERIC key is specified, the large number of records identified with the option will be deleted.

As a next step, the CICS unit of work will be holding a very large number of record locks until syncpoint.

This could cause storage issues within the CICS region and affect other systems.

Deleting the single record which is previously retrieved for UPDATE with READ UPDATE would be better than the GENERIC DELETE.


Syntax:

EXEC CICS 
     DELETE FILE(filename) 
            TOKEN(data-area)
            RIDFLD(data-area)
            KEYLENGTH(data-value)
            GENERIC
            NUMREC(data-area)       
            SYSID(system-name)
            NOSUSPEND
            RBA/RRN   
END-EXEC. 

Lets discuss about the each option in detail.


FILE(filename)

Specifies the name of the file name

File name should be 1 to 8 characters long.

If SYSID is specified, the file refers to the remote system irrespective of file definition in local region.

If SYSID not specified, the file definition should be in the local region.

The file entry should be present in the File Control Table.


TOKEN(data-area)

Specifies the unique identifier for this DELETE request.

The data area length is a full word binary value.

Data area with this TOKEN contains the data area from last READ UPDATE or BROWSE for UPDATE request.

TOKEN is an optional field.


RIDFLD(data-area)

Specifies the record identification field.

Contains the key value used to identify the record to delete.

Contents can be a key value, RBA, RRN.

For RRN, the format of the field is full word binary.

For RBA, the RIDFLD can be greater than or equal to zero.

For RRN, the RIDFLD can be greater than or equal to 1.

RIDFLD is mandatory if GENERIC option specified.


KEYLENGTH(data-value)

Specifies the length of the key specified in the RIDFLD option.

The length field definition is of length half word binary.

KEYLENGTH is not applicable for RBA or RRN specified.

KEYLENGTH option is mandatory if GENERIC is specified.

If the length value specified is different from the length defined for the data set without GENERIC, the INVREQ condition occurs.

If the KEYLENGTH is not less than the length specified in the VSAM definition with GENERIC option, The INVREQ condition occurs.

If zero value specified for KEYLENGTH, the results are unpredictable.


GENERIC:

Specifies that the search key is a partial key/generic key.

The key is with a length specified in the KEYLENGTH option.

The search for a record is to get the same starting characters records from the file.

The search result might be a single record or multiple records.


NUMREC(data-area)

This is only for VSAM files.

Specifies to CICS that sets to the number of deleted records.

Contains the number of records deleted by particular operation.

The data area length is a half word binary.


SYSID(system-name)

Specifies the name of the remote system/local system.

System-name declaration length is 1-4 characters.

If SYSID specified, RBA and RRN can be omitted.


NOSUSPEND (RLS only)

Specifies that the request is not to wait if VSAM is holding by another task.

NOSUSPEND wait for at least 1 second before CICS returns the RECORDBUSY response.


RBA

Specifies RIDFLD contains a relative byte address.

For VSAM KSDS base data sets.

This option used only when deleting records using RBA instead of keys to identify the records.


RRN (VSAM RRDS only)

Specifies that the RIDFLD contains a relative record number.

This option can be used only with files referencing relative record data sets.


Error Conditions:


12 FILENOTFOUND

RESP2 values:
1

The file name referred to in the FILE option cannot be found in the FCT.

The task will be terminated abnormally.


16 INVREQ

RESP2 values:
20

Delete operations are not allowed according to the file definition.

21

A DELETE command is issued on the VSAM ESDS.

22

A GENERIC delete is issued on a file which is not a VSAM KSDS.

25

Error occurs, if the KEYLENGTH is not less than the length specified in the VSAM definition with GENERIC option

26

Error occurs, if the length value specified is different from the length defined for the data set without GENERIC.

31

A DELETE command issued without the RIDFLD option for a file for which no previous READ UPDATE command.

42

The KEYLENGTH and GENERIC options are specified and the length specified in the KEYLENGTH option is less than zero.

55

NOSUSPEND is specified for a non-RLS file.

The task will be terminated abnormally.


17 IOERR

RESP2 values:
120

There is an I/O error during the file control operation.

The task will be terminated abnormally.


19 NOTOPEN

RESP2 values:
60

NOTOPEN (RESP2 60) is returned for one of the following reasons:

• The requested file is CLOSED and UNENABLED.

• The requested file is OPEN and in use by other transactions

• The requested file is CLOSED and ENABLED, so CICS has tried to open the file as part of executing the request.

The task will be terminated abnormally.


53 SYSIDERR

RESP2 values:
130

The SYSID option specifies a name that is not the local system or a remote system.

The task will be terminated abnormally.


70 NOTAUTH

RESP2 values:
101

A resource security check has failed on FILE(filename).

The task will be terminated abnormally.


84 DISABLED

RESP2 values:
50

A file is disabled.

File disabling because of it was initially defined as disabled and has not since been enabled, It has been disabled by a SET FILE or a CEMT SET FILE command.

The task will be terminated abnormally.


100 LOCKED

RESP2 values:
106

An attempt is made to delete a record specifying the RIDFLD which is locked by other process against this key.

The task will be terminated with abend code AEX8.


101 RECORDBUSY

RESP2 values:
107

The NOSUSPEND keyword is specified for the deletion of a record that is locked by a VSAM active lock.

The task will be terminated with abend code AEX8.


CICS File Handling CICS FILE READ

Advertisements