Progress0 of 0 lessons

CICS START (INTERVAL) - Interval Timer Starting

CICS START (INTERVAL) starts an interval timer that will trigger at specified intervals. It enables programs to start timers, manage timer operations, and handle interval timer starting in CICS applications.

What is CICS START (INTERVAL)?

CICS START (INTERVAL) is a command that allows programs to start an interval timer that will trigger at specified intervals. It provides timer starting capabilities, interval management, and timer control for CICS applications.

Command Syntax

cobol
1
2
3
4
5
6
7
8
9
10
EXEC CICS START INTERVAL(interval-name) [TIME(duration)] [AFTER(duration)] [AT(time-value)] [TRANSID(transaction-id)] [FROM(data-area)] [LENGTH(data-length)] [RESP(response-code)] END-EXEC

Parameters

Required Parameters

  • INTERVAL(interval-name) - Name of the interval timer

Optional Parameters

  • TIME(duration) - Duration in hundredths of seconds
  • AFTER(duration) - Delay before first execution
  • AT(time-value) - Absolute time for first execution
  • TRANSID(transaction-id) - Transaction to execute
  • FROM(data-area) - Data to pass to the transaction
  • LENGTH(data-length) - Length of data to pass
  • RESP(response-code) - Response code variable

Programming Examples

Basic Interval Timer Starting

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
WORKING-STORAGE SECTION. 01 INTERVAL-NAME PIC X(8) VALUE 'MYTIMER'. 01 INTERVAL-DURATION PIC S9(8) COMP VALUE 6000. *> 60 seconds 01 TRANSACTION-ID PIC X(4) VALUE 'T001'. 01 PASSED-DATA PIC X(50) VALUE 'Hello from interval timer'. 01 DATA-LENGTH PIC S9(8) COMP VALUE 50. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. *> Start an interval timer EXEC CICS START INTERVAL(INTERVAL-NAME) TIME(INTERVAL-DURATION) TRANSID(TRANSACTION-ID) FROM(PASSED-DATA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC. IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Interval timer started successfully' DISPLAY 'Timer name: ' INTERVAL-NAME DISPLAY 'Duration: ' INTERVAL-DURATION ' hundredths of seconds' DISPLAY 'Transaction: ' TRANSACTION-ID ELSE DISPLAY 'Error starting interval timer: ' RESPONSE-CODE END-IF.

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Interval timer started successfully
  • DFHRESP(INVREQ) - Invalid request or parameter
  • DFHRESP(INVTIME) - Invalid time value
  • DFHRESP(INVDUR) - Invalid duration value
  • DFHRESP(NOTAUTH) - Not authorized to start interval

Performance Considerations

Efficiency

  • Resource Usage - Interval timers consume system resources
  • Duration Selection - Use appropriate interval durations to avoid excessive overhead
  • System Impact - Consider the impact on system performance with many active timers

Best Practices

  • Error Handling - Always check the response code for error handling
  • Naming Convention - Use meaningful interval names for easier management
  • Resource Cleanup - Cancel interval timers when they are no longer needed

Explain It Like I'm 5 Years Old

Think of CICS START (INTERVAL) like setting a repeating alarm:

  • Set Alarm: "Set your alarm to ring every 5 minutes" - Start interval timer
  • Alarm Name: "Give your alarm a name like 'Break Time'" - Interval name
  • What to Do: "Tell it what to do when it rings" - Transaction to start
  • Keep Ringing: "The alarm will keep ringing every 5 minutes" - Repeating timer

Exercises

Exercise 1: Basic Interval Timer

Create a program that starts an interval timer to run every 30 seconds.

Exercise 2: Delayed Timer

Write a program that starts a delayed interval timer.

Exercise 3: Error Handling

Implement error handling for the START (INTERVAL) command.