Why DELETE command is used? - IBM Mainframe

This command is used in deleting one or more records from a VSAM file. The VSAM file format must be KSDS, or RRDS. ESDS format is not valid file type for deleting records with this command. The file may reside on a local or remote CICS system. The RIDFLD option specifies the record entry to be deleted, or for more than one record use the GENERIC option combined with the KEYLENGTH option. This command will also delete a record that has been previously been retrieved by the READ UPDATE command instead of rewriting the record. This command may also delete records from a CICS-maintained data table when the update is made to both the source VSAM KSDS data set and in the in-memory data table. The syntax of the command for a CICS-maintained table is the same as for a VSAM KSDS. The syntax of the DELETE command is given below:

Two examples of the DELETE command are given below:

The various options are given below:

  • FILE (filename) - Alphanumeric field (1-8 characters) of the VSAM file for access. The FCT is used in determining the VSAM file location (local or remote).
  • GENERIC - This option is used when deleting more than one record. The masking of the key is done by specifying this caption, using the RIDFLD, and matching all keys starting with the leftmost character for a length defined in the KEYLENGTH option. This option may only be used with a KSDS or a path over a KSDS. If you specify GENERIC, RIDFLD option must also be defined.
  • KEYLENGTH (data-value) - Halfword binary field containing the key length specified in the RIDFLD option, except when the RBA or RRN option is specified, in which case it is not valid. This option can be specified anytime the RIDFLD option is used and must be defined when the GENERIC option is used. Specifying a KEYLENGTH value of zero will produce unpredictable results. INVREQ condition occurs on this command if the key length size from the VSAM file does not match the KEYLENGTH option specified and the GENERIC option is not used or if the GENERIC option is used and the KEYLENGTH is not less than what was defined on the VSAM file.
  • NUMREC (data-area) - Halfword binary field that is used by CICS to indicate the number of records that were deleted by this command when the GENERIC and KEYLENGTH options are used.
  • RBA - Specifies that the RIDFLD field contain an RBA (relative byte address) value (binary Fullword) for a VSAM KSDS instead of a record key value for processing the command
  • RIDFLD (data-area) - Specifies the record(s) to be deleted. If this option is omitted then the record to be deleted must have been previously retrieved by the READ UPDATE command. The contents of this field are determined by what options are specified. With the RBA or RRN, the value will be a binary fullword, with neither defined; the value is a key for a KSDS VSAM file. This option must be specified when the GENERIC option is used.
  • RRN - Specifies that the RIDFLD field contain an RRN (relative record number) value (binary fullword) for a VSAM RRDS instead of a record key value for processing the command.
  • SYSID (systemname) - Is used and the RBA and RRN options are omitted, then the KEYLENGTH must be specified because it cannot be found in the FCT definition.
  • The handle conditions for the DELETE command are:
  • DISABLED - The VSAM file is disabled for any of the following reasons:
    1. Defined initially as disabled and never been set to enable.
    2. Either command EXEC CICS SET FILE or CEMT SET FILE disabled the table. When deleting a record that was just read for an update this condition cannot occur.

The default action is the abnormal termination of the task.

  • DUPKEY - Occurs only when attempting to delete a record by way of an alternate index path. which has an attribute of NONUNIQUEKEY, and there exist more than one record for the key specified. The command will delete only the first occurrence of the key. The default action is the abnormal termination of the task.
  • FILENOTFOUND - The file name used in the FILE option of the command is not defined to the CICS system. The default action is the abnormal termination of the task.
  • ILLOCIC - This error occurs for all other VSAM errors that are not specified here for this command. The default action is the abnormal termination of the task.
  • INVREQ - The default action of INVREQ is the abnormal termination of the task. This can occur for any of the following reasons:
    1. The file definition in CICS did not allow for the delete operation.
    2. Command issued against a VSAM file type of ESDS.
    3. Command issued against a VSAM file that is not KSDS.
    4. Options GENERIC and KEYLENGTH are used and the specified length on the KEYLENGTH option is greater than or equal in size to the length of the key defined to the file.
    5. KEYLENGTH option is specified without the GENERIC option and the length does not match the key length defined to the file being referenced in the command.
    6. Command issued against a file type of BDAM.
    7. The command was executed without the RIDFLD option for which there was not a previous READ UPDATE command issued against the file.
    8. The command was executed with the RIDFLD option when there was an outstanding READ UPDATE command issued against the file.
    9. The KEYLENGTH and GENERIC options are specified, and the length value specified in the KEYLENGTH option is less than zero.
  • IOERR - An I/O error occurred during a file control operation with a VSAM file. I/O errors are generally not covered CICS because it is an unusually event and when it does occur, it is an indication of a hardware problem where the VSAM file resides. The default action is the abnormal termination of the task.
  • ISCINVREQ - Indicates failure in a remote system, which does not correspond to a known condition. The default action is the abnormal termination of the task.
  • NOTAUTH - Resource security check failure on a delete request against the filename specified in the FILE option. The default action is the abnormal termination of the task.
  • NOTFND - An unsuccessful delete record attempt occurred based on the search argument provided is unsuccessful. The default action is the abnormal termination of the task.
  • NOTOPEN - Error occurs for any of the following reasons:
    1. The file requested is CLOSED and UNENABLED. This state is achieved when a CLOSE request against an OPEN ENABLED file is issued and the table is no longer in use. The file can also have the initial state of CLOSED and UNENABLED set through the RDO options of STATUS=UNENABLED and OPENT1ME = FIRSTREF or by using the FILSTAT parameter of the file control table TYPE=FILE.
    2. The file is currently OPEN and in use by other transaction, but a CLOSE request against it has been issued and received. For file's that are in a state of CLOSED, ENABLED or DISABLED, this condition does not occur. For CLOSED, ENABLED the file is opened as part of executing the request. For CLOSED, DISABLED the DISABLED error condition occur instead. This error also cannot occur when deleting a record that was just read for update.

The default action is the abnormal termination of the task.

  • SYSIDERR - Occurs when either the remote name specified in the SYSID option is closed or has not been defined to the host CICS system. (This is accomplished by defining a CONNECTION in CICS). The default action is the abnormal termination of the task.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics