CICS - Nohandle



Nohandle can be specified for any CICS command. It will cause no action to be taken for any exceptional conditions that may occur during the execution of the CICS command. 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 syntax of Nohandle is as follows −

Syntax

EXEC CICS
   program statements
   NOHANDLE    
END-EXEC.

Example

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

IDENTIFICATION DIVISION.                                         
PROGRAM-ID. HELLO.                                               
PROCEDURE DIVISION.
EXEC CICS READ   
   FILE('FILE1')                
   INTO(WS-FILE-REC)             
   RIDFLD(WS-STDID)             
   NOHANDLE                          
END-EXEC. 
cics_error_handling.htm
Advertisements