TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

CICS NOHANDLE Option


If you want to deactivate all the conditions for a particular CICS command, code NOHANDLE.

This command temporarily deactivates all the other handle conditions. If an exception arises during the execution of the command, the control will be transferred to the next statement after the Command. It can be used with Read, Write, Delete, etc.

The NOHANDLE option may be coded on any CICS command to ignore any condition that occurs upon execution of that command. This option applies only to the CICS command on which it is included. The use of the RESP option implies NOHANDLE. NOHANDLE overrides the HANDLE AID command, and tests for PF keys are ignored.

EXEC CICS HANDLE CONDITION
	MAPFAIL(PARA-1)
	PGMIDERR(PARA-2)
	LENGERR(PARA-3)
	ERROR(PARA-X)
END-EXEC.

There are possibilities for infinite loop when the CICS command in the exception routine of the HANDLE CONDITION ends with same exception. In the above example, if the there is LENGERR in PARA-3 for any of the CICS command coded there, then the control again come to PARA-3 and forms infinite loop. In such cases, NOHANDLE will be useful (in the ABEND routine CICS commands).


Syntax:

The NOHANDLE option can be coded as follows:

EXEC CICS
   program statements
   NOHANDLE
END-EXEC.

Example:

Following is the example of Nohandle command. We are using it with a RECEIVE statement. If RECEIVE statement fails, it will not abend the program.

EXEC CICS RECEIVE
    INTO (WS-INPUT)
    LENGTH (WS-LENGTH)
    NOHANDLE
END-EXEC

If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal