Progress0 of 0 lessons

CICS IGNORE CONDITION - Condition Ignoring

CICS IGNORE CONDITION provides condition ignoring capabilities in CICS environments. It enables programs to ignore conditions, manage condition processing, and handle condition ignoring for selective condition handling and program flow control.

Command Syntax

cobol
1
2
3
4
5
EXEC CICS IGNORE CONDITION [CONDITION(condition-name)] [RESP(response-code)] [RESP2(response-code-2)] END-EXEC.

Parameters

CONDITION(condition-name)

Specifies the name of the condition to be ignored. This parameter identifies the specific condition for ignoring operations.

RESP(response-code)

Specifies the response code variable to receive the operation result. This parameter provides error handling and status information.

RESP2(response-code-2)

Specifies the secondary response code variable for additional error information. This parameter provides extended error details when available.

Ignoring Types

Error Condition Ignoring

IGNORE CONDITION suppresses error conditions such as file errors, data errors, and system errors for continued program execution.

End-of-File Ignoring

The command supports end-of-file condition ignoring for handling file processing completion without interruption.

Data Condition Ignoring

Data condition ignoring suppresses data validation errors, format errors, and data processing exceptions for data processing flexibility.

System Condition Ignoring

System condition ignoring suppresses system-level errors, resource limitations, and operational exceptions for system operation flexibility.

Programming Examples

Basic Condition Ignoring

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
WORKING-STORAGE SECTION. 01 CONDITION-NAME PIC X(16) VALUE 'ERROR'. 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS IGNORE CONDITION CONDITION(CONDITION-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 DISPLAY 'Condition ignored successfully' DISPLAY 'Condition: ' CONDITION-NAME ELSE DISPLAY 'Error ignoring condition: ' RESPONSE-CODE END-IF. PERFORM PROCESS-DATA PERFORM CONTINUE-PROCESSING.

Multiple Condition Ignoring

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
WORKING-STORAGE SECTION. 01 CONDITION-NAME PIC X(16). 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. 01 IGNORE-COUNT PIC S9(8) COMP VALUE 0. PROCEDURE DIVISION. PERFORM IGNORE-FILE-ERRORS PERFORM IGNORE-DATA-ERRORS PERFORM IGNORE-SYSTEM-ERRORS. IGNORE-FILE-ERRORS. MOVE 'FILE-ERROR' TO CONDITION-NAME EXEC CICS IGNORE CONDITION CONDITION(CONDITION-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO IGNORE-COUNT DISPLAY 'File errors ignored' END-IF. IGNORE-DATA-ERRORS. MOVE 'DATA-ERROR' TO CONDITION-NAME EXEC CICS IGNORE CONDITION CONDITION(CONDITION-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO IGNORE-COUNT DISPLAY 'Data errors ignored' END-IF. IGNORE-SYSTEM-ERRORS. MOVE 'SYSTEM-ERROR' TO CONDITION-NAME EXEC CICS IGNORE CONDITION CONDITION(CONDITION-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO IGNORE-COUNT DISPLAY 'System errors ignored' END-IF.

Dynamic Condition Ignoring

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
WORKING-STORAGE SECTION. 01 CONDITION-NAME PIC X(16). 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. 01 PROCESSING-COUNT PIC S9(8) COMP VALUE 0. PROCEDURE DIVISION. PERFORM VARYING PROCESSING-COUNT FROM 1 BY 1 UNTIL PROCESSING-COUNT > 3 PERFORM BUILD-CONDITION-NAME PERFORM IGNORE-CONDITION END-PERFORM. BUILD-CONDITION-NAME. EVALUATE PROCESSING-COUNT WHEN 1 MOVE 'EOF' TO CONDITION-NAME WHEN 2 MOVE 'INVREQ' TO CONDITION-NAME WHEN 3 MOVE 'NOTFND' TO CONDITION-NAME END-EVALUATE. IGNORE-CONDITION. EXEC CICS IGNORE CONDITION CONDITION(CONDITION-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 DISPLAY 'Condition ' CONDITION-NAME ' ignored successfully' ELSE DISPLAY 'Error ignoring condition ' CONDITION-NAME ': ' RESPONSE-CODE END-IF.

Error Handling

Response Code 0

Successful condition ignoring. The condition has been successfully ignored and will not interrupt program execution.

Response Code 8

Invalid condition name. The specified condition name is invalid or not supported.

Response Code 12

Condition not ignorable. The specified condition cannot be ignored due to system requirements.

Response Code 16

Ignore operation failed. The condition ignoring operation failed due to system conditions.

Response Code 20

Ignore not available. The condition ignoring capability is not available in the current execution context.

Performance Considerations

Ignoring Efficiency

IGNORE CONDITION efficiently suppresses conditions, but excessive ignoring may mask important errors and impact system reliability.

Condition Management

Proper condition management ensures appropriate ignoring and prevents masking of critical system conditions.

Error Visibility

Error visibility should be maintained to ensure important conditions are not inadvertently ignored.

Best Practices

Error Handling

Always check response codes and handle errors appropriately, especially for condition validation and ignoring operations.

Selective Ignoring

Use selective condition ignoring to suppress only non-critical conditions while maintaining error visibility for important conditions.

Condition Analysis

Analyze conditions carefully before ignoring to ensure that critical errors are not masked and system integrity is maintained.

Ignoring Strategy

Implement appropriate ignoring strategies that balance program flexibility with system reliability and error visibility.

Explain It Like I's 5 Years Old

Imagine you're playing a game and you don't want to be bothered by certain sounds. CICS IGNORE CONDITION is like putting on headphones to ignore those sounds so you can keep playing.

The condition name is like the name of the sound you want to ignore (like "loud music"). When you ignore it, you won't hear that sound anymore, so you can focus on your game.

Just like you need to be careful not to ignore important sounds (like someone calling your name), the program needs to be careful not to ignore important errors.

Exercises

Exercise 1: Basic Condition Ignoring

Write a program that uses IGNORE CONDITION to suppress a specific condition and verify the ignoring was successful.

Exercise 2: Multiple Condition Suppression

Create a program that ignores multiple types of conditions (file errors, data errors, system errors) with appropriate validation.

Exercise 3: Selective Condition Management

Implement a condition management system that selectively ignores non-critical conditions while maintaining error visibility for important conditions.