UNLOCK


Release the exclusive control exists on file. UNLOCK releases the exclusive control established by read command with the UPDATE option. UNLOCK used to release the lock if the locked record do not want to update after all. However for a recoverable file, the resource remains locked until either a SYNCPOINT command is executed or the task is terminated.

The record can be in a data set or in a CICS on a local or a remote system. If changes have been made to the record, it remains locked until either a SYNCPOINT command or the task is terminated.

Syntax -


UNLOCK Syntax

Parameters -


FILE(file-name) -

Specifies the name of the file to be released. If SYSID is specified, the data set is on a remote system irrespective of the name is defined to CICS. If SYSID is not specified, the data set assumed to be on the local system. Otherwise, the resource definition is used to find out whether the data set is on a local or a remote system.

SYSID(system-name) -

Specifies the name of the system to which the request is directed.

TOKEN(data-area) -

data-area is fullword binary value. Specifies a unique request identifier for an UNLOCK associate it with a previous READ, READNEXT or READPREV command that specified the UPDATE option.

Error Conditions -


Below are the list of error conditions may occur in combination. If more than one occurs, only the first is passed to the application program.

Error ConditionRESP2, Description & SolutionSystem Action
84 DISABLED
50 - A file is disabled.
Solution -Check the file status and enable the file using SET FILE or CEMT SET FILE
Task abnormally terminated
12 FILENOTFOUND 1 - A file name in the FILE option is not defined to CICS and SYSID has not been specified.
Solution -Contact support team to define the FILE in CICS region.If the file belongs to the remote region, modify the program to specify the SYSID.
Task abnormally terminated
21 ILLOGIC
110 - VSAM error occurs that is not in one of the other CICS response categories.
Solution -This might be due to the non-sequence of file operations. Debug the program to correct the logic.
Task abnormally terminated
16 INVREQ
47 - An unlock includes a token whose value cannot be matched against any token in use for an existing READ with the UPDATE option.
Solution -READ with UPDATE or UNLOCK tokens should match. This might be a logic issue. Modify the program logic to resolve the issue.
Task abnormally terminated
17 IOERR
120 - There is an I/O error during the ENDBR operation.
Solution -An I/O error is any unusual event that is not covered by a CICS condition. For VSAM files, IOERR usually indicates a hardware error.
Task abnormally terminated
54 ISCINVREQ
70 - The remote system indicates a failure that does not correspond to a known condition.
Solution -Contact remote system support team to resolve the issue.
Task abnormally terminated
19 NOTOPEN
60 - Below are the reasons for NOTOPEN
  • The requested file is CLOSED and UNENABLED.
    Solution -Open and enable the file using SET FILE or a CEMT SET FILE command. If no access, contact support team to enable the file.
  • The requested file is OPEN and in use by other transactions, but a CLOSE request against the file has been received.
    Solution -The CLOSE request might for using the file in batch environment. Wait for some time and try again later once the file enabled.
  • The requested file is CLOSED and ENABLED, so CICS has tried to open the file as part of executing the request.
    Solution -Open the file using SET FILE or a CEMT SET FILE command. If no access, contact support team to open the file.
Task abnormally terminated
70 NOTAUTH
101 - A resource security check has failed on FILE (filename).
Solution -Contact system administrator team to check whether the appropriate access added for the user or group. It will resolve the problem.
Task abnormally terminated
53 SYSIDERR
130 - The SYSID name specified is neither the local region nor a remote system or the link to the remote system is closed.
Solution -The specified SYSID name is not related to any system. Correct it.If the link to the remote system is closed, that might be due to the remote system is not up and running. Contact remote system support team.
Task abnormally terminated