syntax of the UNLOCK command - IBM Mainframe

The UNLOCK when executed will release the exclusive control established during the READ UPDATE command. The command is used to release a record that was retrieved for update when it was determined that no update was needed. The command is also used to terminate a VSAM WRITE MASSINSERT operation. However, for files where the system programmer has specified the automatic logging, the resource remains under the task control enqueue until either a syncpoint command is executed or the task is terminated. The record can be in a file, or on a CICS maintained data table, on a local or a remote system. The syntax of the UNLOCK command is given below:

Given below is an example of UNLOCK command:

The various options of the command are explained below:

  • FILE (filename) - Contains the name of the file to be released. The FCT entry for the filename will determine where the location (local or remote) of the data set resides. However, when the SYSID option is used, the location of the filename is assumed to exist on a remote system regardless of what the entry has defined in the FCT if one exists on the local system
  • SYSID (systemname) - Character field (4 bytes) specifying the name "for the APPC connection where the request will be directed to. The major handle conditions are given below:
  • DISABLED - This is set when a file is disabled. This condition does not occur when the UNLOCK follows a successful read for update or a VSAM WRITE MASSINSERT.

The UNLOCK when executed will release the exclusive control established during the READ UPDATE command. The command is used to release a record that was retrieved for update when it was determined that no update was needed. The command is also used to terminate a VSAM WRITE MASSINSERT operation. However, for files where the system programmer has specified the automatic logging, the resource remains under the task control enqueue until either a syncpoint command is executed or the task is terminated. The record can be in a file, or on a CICS maintained data table, on a local or a remote system. The syntax of the UNLOCK command is given below:

EXEC CICS UNLOCK FILE (filename) [SYSID (systemname)] END-EXEC.

Given below is an examdefault action is the abnormal termination of the task. This can occur if:

  • It was initially defined as disabled and has not since been enabled
  • It has been disabled by an EXEC CICS SET FILE or a CEMT SET FILE command.
  • FILENOTFOUND - Set when a file name specified in the FILE option of the command cannot be located in the FCT. The default action is the abnormal termination of the task.
  • ILLOCIC (VSAM only) - Set when a VSAM error occurs that is not defined by one of the other CICS response categories. The default action is the abnormal termination of the task.
  • IOERR - Set when an I/O error occurs during the READ. An I/O error can be any unusual event not covered by an existing CICS condition. For VSAM files, IOERR normally indicates a hardware error. The default action is the abnormal termination of the task.
  • ISCINVREQ - Set when the remote system indicates a failure that is not covered by an existing CICS condition. The default action is the abnormal termination of the task.
  • NOTAUTH - Resource security check failure has occurred on FILE (filename). The default action is the abnormal termination of the task.
  • NOTOPEN - Set for any one of the following conditions that may occur. The default action is the abnormal termination of the task.
    1. The requested file is a CLOSED and UNENABLED state. This condition occurs after a CLOSE request has been received against an OPEN ENABLED file and the file is no longer in use. The CLOSED UNENABLED state can also be set by specifying the initial state of the F1LSTAT parameter (TYPE=FILE) of the FCT, or by defining the RDO options for the file definition as STATUS=UNENABLED and OPENTIME=FIRSTREF.
    2. The requested file is in use by other transactions with an OPEN status but a CLOSE request against the file has been received. This error does not occur when the request is made to a file that has a status of either CLOSED ENABLED or CLOSED DISABLED. The CLOSED ENABLED condition when encountered from this command will cause the file to open as part of executing the request. When the CLOSED DISABLED condition is encountered the DISABLED condition is set as a result of executing this command.
  • SYSIDERR - The SYSID specified cannot be found in the intersystem table, (defined in CICS by defining a CONNECTION), or if the link to the remote system is unavailable or closed. 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