Menu principal                 [Fechar]


CICS Manual do Usuário - DELETE


Volta a página anterior

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

DELETE

Deletes a record from a file.

Sintaxe

Condições: DISABLED, DUPKEY, FILENOTFOUND, ILLOGIC, INVREQ, IOERR, ISCINVREQ, NOTAUTH, NOTFND, NOTOPEN, SYSIDERR,

Notas:

  1. DATASET is also accepted, but FILE is preferred.
  2. DSIDERR is equivalent to FILENOTFOUND.

Descrição:

DELETE deletes a record from a KSDS, a KSDS through an alternative index path, or an RRDS. The file can be on a local or a remote system.
Note that DELETE cannot delete records from an ESDS. Three forms of this command are available:

  • You identify, in the RIDFLD option, the specific record that is to be deleted.
  • You can delete a group of records in a similar way with a single invocation of this command.
    You use the GENERIC option to identify the group.
  • You can use a different form of this command to delete a single record that has previously been retrieved for update (by a READ UPDATE command).
    The record is deleted, instead of being rewritten, by this command.
    In this case, you must not specify the RIDFLD option.

The following example shows how to delete a group of records in a file:

    EXEC CICS 
         DELETE
         FILE('MASTFILE')
         RIDFLD(ACCTNO)
         KEYLENGTH(4)
         GENERIC							     
         NUMREC(NUMDEL)
    END-EXEC 

Opções:

    FILE(name)
  • Specifies the name of the CICS file that is to be accessed in a maximum of eight alphanumeric characters.
  • The file must be currently DELETABLE (see INQUIRE FILE).
  • If a remote SYSID is specified, the underlying file is assumed to reside on a remote system whether or not the name exists in the local File Definitions (FD).
  • Otherwise, the FD entry is used to determine whether the underlying file is on a local or a remote system.
    GENERIC
  • Specifies that the search key is a generic key whose length is specified in the KEYLENGTH option.
  • Use this option only with a KSDS or a KSDS through an alternative index path. The search is satisfied on finding a record whose key has the same starting characters (generic key) as those that are specified in the RIDFLD option.
  • If you specify GENERIC, you must also specify RIDFLD.
    KEYLENGTH(data-value)
  • Specifies, as a 16-bit binary value, the length of the key that is supplied in the RIDFLD option.
  • If KEYLENGTH is omitted, and both GENERIC and SYSID are also omitted, CICS obtains the length of the key if the file is local, or it is provided by the KeyLen attribute in the FD if the file is remote.
  • If either GENERIC or SYSID is present, KEYLENGTH is required; the length cannot be taken from the FD.
  • See KEYLENGTH and RIDFLD for more information about using this option.

  • Do not use KEYLENGTH if the record identification field that is specified in the RIDFLD option contains a relative record number (use the RRN option).
  • If a specified KEYLENGTH value differs from the length that is defined for the underlying file and the operation is not generic, the INVREQ condition occurs.
  • INVREQ also occurs if you specify the GENERIC option and the KEYLENGTH value is greater than that which is specified in the File Definitions (FD) (see previous information).
    NUMREC(data-area)
  • Specifies a 16-bit binary field that is to receive the number of records that have been deleted.
    RIDFLD(data-area)
  • Specifies the record identification field.
  • The contents can be a key or a relative record number.

  • For a relative record number, the format of this field must be 32-bit binary and the RRN option must be specified.
  • A relative record number can be greater than or equal to 1.
  • You must specify the RIDFLD option if you have also specified GENERIC, or if the DELETE command is being issued for a specific record for which no previous READ UPDATE command has been issued.
  • If you specify this option, you must also specify either KEYLENGTH or RRN, depending on the contents of the record identification field.
  • See KEYLENGTH and RIDFLD for more information about using this option.
    RRN
  • Specifies that the record identification field that is supplied in the RIDFLD option contains a relative record number.
  • Use this option only when deleting records from an RRDS.
  • Do not use the RRN option if the record identification field that is supplied in the RIDFLD option contains a key (use the KEYLENGTH option).
    SYSID(name)
  • Specifies the CICS region on which the DELETE is to run.
  • The SYSID name has one through four characters.
  • For a full description of the SYSID option, refer to SYSID.

  • If the SYSID option is not specified, it defaults to the value that is in the RemoteSysId attribute of the FD entry for the file that is requested in the FILE option.
  • If the SYSID option requests a remote SYSID and the RIDFLD option is used, you must also specify either the RRN or the KEYLENGTH option.
  • The choice between RRN and KEYLENGTH depends on the value that is specified for RIDFLD.

Condições:

    DISABLED
  • Occurs if a file is disabled. A file can be disabled for the following reasons:
    • It was initially defined as disabled and has not since been enabled.
    • It has been disabled by an EXEC CICS SET FILE command or by the CEMT transaction.
  • This condition cannot occur when a record that has just been read for update is deleted.
  • Ação pré-definida: Terminates the task abnormally.
    DUPKEY
  • Occurs if, following a successful deletion, further records remain that match the specified RIDFLD.
  • Ação pré-definida: Terminates the task abnormally.
    FILENOTFOUND
  • Occurs if the name that is specified in the FILE option cannot be found in the FD.
  • Ação pré-definida: Terminates the task abnormally.
    ILLOGIC
  • Occurs if an error occurs that does not belong to one of the other CICS response categories.
  • Further information is available in the EIBRCODE field; see Appendix A, EXEC interface block (EIB) fields for details.
  • Ação pré-definida: Terminates the task abnormally.
    INVREQ
  • Occurs for the following conditions, depending on the options that are specified on the DELETE command:
    • Delete operations are not currently allowed for the file.
    • A DELETE command without the RIDFLD option is issued for a file for which no previous READ UPDATE command has been issued.
    • The KEYLENGTH option is specified (but the GENERIC option is not specified), and the specified length differs from the length that is defined for the underlying file.
    • The KEYLENGTH and GENERIC options are specified, and the length that is specified in the KEYLENGTH option is greater than or equal to the length of a full key.
    • The KEYLENGTH and GENERIC options are specified, and the length that is specified in the KEYLENGTH option is less than or equal to zero.
    • A DELETE command is issued for a file that is referring to an ESDS.
    • A DELETE command with the RIDFLD option specified is issued for a file when a READ UPDATE command is outstanding.
    • A generic delete is issued for a file that is not a KSDS.
    • An invalid combination of RIDFLD and RRN is specified for the file type.
  • Ação pré-definida: Terminates the task abnormally.
    ISCINVREQ
  • Occurs if the remote system indicates a failure that does not correspond to a known condition.
  • Ação pré-definida: Terminates the task abnormally.
    NOTAUTH
  • Occurs for the following conditions:
    • When a resource security check is unsuccessful on FILE(name).
    • When SYSID is specified by a transaction that is defined with the RSLCheck attribute set to either internal or external.
  • Ação pré-definida: Terminates the task abnormally.
    NOTFND
  • Occurs if an attempt to delete a record based on the search argument that is provided is unsuccessful.
  • Ação pré-definida: Terminates the task abnormally.
    NOTOPEN
  • Occurs for the following conditions:
    • The requested file is CLOSED and UNENABLED. The CLOSED, UNENABLED state is reached after a CLOSE request has been received against an OPEN ENABLED file, and the file is no longer in use.
    • The requested file is OPEN and in use by other transactions, but a CLOSE request against the file has been received.
    • Current activity is allowed to complete, but no new activity is allowed to start.
  • This condition does not occur if the request is made to either a CLOSED, ENABLED file or a CLOSED, DISABLED file.
  • In the first case, the file is opened as part of executing the request.
  • In the second case, the DISABLED condition occurs.
  • It also cannot occur when a record just read for update is deleted.
  • Ação pré-definida: Terminates the task abnormally.
    SYSIDERR
  • Occurs if a problem with the communications configuration prevents the DELETE from proceeding.
  • For example:
    • The connection that is named in the SYSID option is not the name of a Communications Definition (CD) entry.
    • The SYSID option references a CD entry that is incorrectly configured.
    • The SYSID option references a CD entry that is marked as out of service.
  • It can also occur if the connection to the remote system is closed.
  • This can be because the remote system is not available.
  • Ação pré-definida: Terminates the task abnormally.

Informações relacionadas:



© Copyright IBM Corp.