CICS CANCEL (INTERVAL) cancels a previously scheduled interval timer. It enables programs to stop interval timers, manage timer operations, and handle interval timer cancellation in CICS applications.
CICS CANCEL (INTERVAL) is a command that allows programs to cancel a previously scheduled interval timer. It provides timer cancellation capabilities, interval management, and timer cleanup for CICS applications.
1234EXEC CICS CANCEL INTERVAL(interval-name) [RESP(response-code)] END-EXEC
1234567891011121314151617181920212223242526272829WORKING-STORAGE SECTION. 01 INTERVAL-NAME PIC X(8) VALUE 'MYTIMER'. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. *> Start an interval timer first EXEC CICS START INTERVAL(INTERVAL-NAME) TIME(60) RESP(RESPONSE-CODE) END-EXEC. IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Interval timer started successfully' *> Later, cancel the interval timer EXEC CICS CANCEL INTERVAL(INTERVAL-NAME) RESP(RESPONSE-CODE) END-EXEC. IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Interval timer cancelled successfully' ELSE DISPLAY 'Error cancelling interval: ' RESPONSE-CODE END-IF ELSE DISPLAY 'Error starting interval: ' RESPONSE-CODE END-IF.
Think of CICS CANCEL (INTERVAL) like turning off an alarm clock:
Create a program that starts an interval timer and then cancels it after a short delay.
Write a routine that manages multiple interval timers and cancels them when no longer needed.
Implement error handling for the CANCEL (INTERVAL) command.