START
START
The CICS START statement is used to initiate a new transaction asynchronously in a CICS region. Unlike normal transaction flow where a program executes sequentially, START schedules a new transaction to execute in parallel or at a later time.
This command is particularly useful for:
- Triggering background processing without delaying the current transaction.
- Scheduling transactions to execute at a future time.
- Passing data from one transaction to another asynchronously.
Syntax -
EXEC CICS START
TRANSID('transaction-id')
[INTERVAL(hhmmss)]
[TIME(hhmmss)]
[AFTER HOURS(hh) | MINUTES(mm) | SECONDS(ss)]
[AT HOURS(hh) | MINUTES(mm) | SECONDS(ss)]
[FROM(data-area)]
[LENGTH(data-length)]
[TERMID('terminal-id')]
[SYSID('system-id')]
[RTRANSID('transaction-id')]
[RTERMID('terminal-id')]
[RESP(response-field)]
[RESP2(response-field2)]
END-EXEC.
- TRANSID('transaction-id') - Specifies the transaction ID to be started.
- TERMID('terminal-id') - Optional. Specifies the terminal where the transaction should run.
- FROM(data-area) - Optional. Specifies a data area (COMMAREA) to pass data to the new transaction.
- LENGTH(data-length) - Optional. Defines the length of the COMMAREA.
- AT(time) - Schedules the transaction to start at a specific time (HHMMSS format).
- AFTER(time) - Optiional. Delays execution by a specified number of minutes.
- RTRANSID('transaction-id') - Optional. Specifies the transaction ID to be returned.
- SYSID(system-name) - Specifies the system name to which the request is directed.
- RESP(response-variable) - Optional. It captures the response code of the START operation and used to check if the command executed successfully or encountered an error.
- RESP2(response2-variable) - Optional. It captures the response2 code of the START operation when the error occured.
Short Examples -
Scenario - Starting a Transaction Immediately
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-TRANS-ID PIC X(4) VALUE 'TRN1'.
01 WS-RESP PIC S9(4) COMP.
PROCEDURE DIVISION.
EXEC CICS START
TRANSID(WS-TRANS-ID)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL) THEN
...
ELSE
...
END-IF.
...
The transaction ID TRN1 is specified. START initiates the transaction asynchronously. The response code (RESP) is checked to confirm that the operation was successful. The original transaction continues executing without waiting for TRN1 to complete.
Error Conditions -
Eror Condition | RESP | RESP2 | Reason |
---|---|---|---|
INVREQ | 16 | 4 | The value specified in HOURS, for AFTER or AT options, or the hh value specified for INTERVAL, is out of range. |
16 | 5 | The value specified in MINUTES, for AFTER or AT options, or the mm value specified for INTERVAL, is out of range. | |
16 | 6 | The value specified in SECONDS, for AFTER or AT options, or the ss value specified for INTERVAL, is out of range. | |
16 | 17 | The transaction that has been started by the START operation is not shutdown-enabled, and the CICS region is in the process of shutting down. | |
IOERR | 17 | Occurs in any of the following situations:
| |
LENGERR | 22 | Occurs if LENGTH is not greater than zero. | |
NOTAUTH | 70 | 7 | A resource security check fails on TRANSID (name). |
70 | 9 | A surrogate user security check fails on USERID (name). | |
SYSIDERR | 53 | 1 | The dynamic routing program rejected the START request. |
TERMIDERR | 11 | Occurs if the terminal identifier in a START command is not defined to CICS. | |
TRANSIDERR | 28 | Occurs if the transaction identifier specified in a START command is not defined to CICS. |