DELETEQ TS
DELETEQ TS
The CICS DELETEQ TS statement is used to delete an entire temporary storage queue (TSQ) that was previously created. It removes all records (items) stored in the queue, freeing up system resources.
Points to note -
- We are unable to delete individual items from the TSQ; we must delete the entire queue. Deleting the queue removes all its records. The deletion of a recoverable TSQ should occur after a SYNCPOINT before the next WRITEQ.
Syntax -
EXEC CICS DELETEQ TS
QUEUE('queue-name')
[SYSID(system-name)]
[RESP(response-field)]
[RESP2(response-field2)]
END-EXEC.
- QUEUE('queue-name') - Specifies the name of the temporary storage queue to be deleted.
- SYSID(system-name) - Specifies the system name to which the request is directed.
- RESP(response-variable) - Optional. It captures the response code of the DELETEQ TS 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 DELETEQ TS operation when the error occured.
How it works?
- A queue name is provided in the QUEUE parameter.
- The DELETEQ TS command removes the entire queue and all its items.
- If the queue does not exist, an error response (QIDERR) is returned.
- The queue cannot be accessed after deletion, ensuring data integrity.
- System resources previously occupied by the queue are released.
Short Examples -
Scenario - Deleting a Temporary Storage Queue
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-QUEUE-NAME PIC X(8) VALUE 'TSQTEST'.
01 WS-RESP PIC S9(4) COMP.
PROCEDURE DIVISION.
EXEC CICS DELETEQ TS
QUEUE(WS-QUEUE-NAME)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL) THEN
...
ELSE
...
END-IF.
...
The queue name TSQTEST is specified. The DELETEQ TS command is executed to remove the queue. The response code is checked to confirm whether the deletion was successful or if the queue did not exist.
Error Conditions -
Eror Condition | RESP | RESP2 | Reason |
---|---|---|---|
INVREQ | 16 | Queue name specifies consisting of binary zeroes or queue locked and waiting for ISC recovery or queue created by CICS internal code. | |
QIDERR | 44 | Occurs when the queue specified cannot be found in Main storage, Auxiliary storage. | |
SYSIDERR | 53 | 4 | Occurs in any of the following situations:
|
NOTAUTH | 70 | A resource security check has failed on QUEUE (name). |