
- CICS Tutorial
- CICS - Home
- CICS - Overview
- CICS - Environment
- CICS - Basic Terms
- CICS - Nucleus
- CICS - Transactions
- CICS - COBOL Basics
- CICS - BMS
- CICS - MAP
- CICS - Interface Block
- CICS - Pseudo Programming
- CICS - Aid Keys
- CICS - File Handling
- CICS - Error Handling
- CICS - Control Operations
- CICS - Temporary Storage
- CICS - Intercommunication
- CICS - Status Codes
- CICS - Interview Questions
- CICS Useful Resources
- CICS - Quick Guide
- CICS - Useful Resources
- CICS - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CICS - Handle condition
Handle condition is used to transfer the control of the program to a paragraph or a procedure label. If the condition name specified in the exception block arises, the particular para will be given control and then we can handle that condition.
HANDLE CONDITION can handle only conditions related to CICS, not the ordinary program Abends like as data exceptions. It can handle conditions that are related only to CICS. It cannot handle the ordinary program Abends like as data exceptions. The syntax of Handle Condition is as follows −
Syntax
EXEC CICS HANDLE CONDITION CONDITION(Label) CONDITION(Label) ERROR(LABEL) END-EXEC.
Example
Following is the example of Handle condition −
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. PROCEDURE DIVISION. EXEC CICS HANDLE CONDITION DUPKEY(X0000-DUPKEY-ERR-PARA) NOTFND(X000-NOT-FOUND-PARA) ERROR(X0000-GEN-ERR-PARA) END-EXEC. X0000-DUPKEY-ERR-PARA. DISPLAY 'Duplicate Key Found'. X0000-NOT-FOUND-PARA. DISPLAY 'Record Not Found'. X0000-GEN-ERR-PARA. DISPLAY 'General Error'.
cics_error_handling.htm
Advertisements