DELETEQ TD
The CICS DELETEQ TD statement is used to delete all messages from an intrapartition transient data queue (TDQ). While it removes the data stored in the TDQ, it does not delete the queue itself, as TDQs are predefined in the system's Transient Data Table (TCT).
Once executed, all storage associated with the queue is released or deallocated. It’s important to note that this command cannot be used to delete an extra-partition transient data queue; attempting to do so will result in an INVREQ condition.
Syntax -
EXEC CICS DELETEQ TD
QUEUE('queue-name')
[SYSID(system-name)]
[RESP(response-field)]
[RESP2(response-field2)]
END-EXEC.
- QUEUE('queue-name') - Specifies the name of the transient data 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 TD 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 TD operation when the error occured.
How it works?
- The DELETEQ TD command removes all messages from the specified intrapartition TDQ.
- It does not delete the queue definition, only the stored messages.
- If the queue is empty, the operation completes successfully with no effect.
- Extrapatrition queues cannot be deleted using DELETEQ TD.
- After deletion, new messages can still be written to the queue using WRITEQ TD.
Short Examples -
Scenario - Deleting a Temporary Storage Queue
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-QUEUE-NAME PIC X(4) VALUE 'TDQA'.
01 WS-RESP PIC S9(4) COMP.
PROCEDURE DIVISION.
EXEC CICS DELETEQ TD
QUEUE(WS-QUEUE-NAME)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL) THEN
...
ELSE
...
END-IF.
...
The queue name TDQA is specified in WS-QUEUE-NAME. The DELETEQ TD command is executed, clearing all messages from the queue. The response code (RESP) is checked to confirm whether the deletion was successful.
Error Conditions -
Eror Condition | RESP | RESP2 | Reason |
---|---|---|---|
INVREQ | 16 | Occurs if deleting an extra-partition queue. | |
QIDERR | 44 | Occurs when the queue specified cannot be found. | |
SYSIDERR | 53 | Occurs when the SYSID option specifies a name that is neither the local system nor a remote system. | |
ISCINVREQ | 54 | Occurs if remote system indicates a failure without a known condition. | |
NOTAUTH | 70 | A resource security check has failed on QUEUE (name). | |
DISABLED | 84 | Occurs when the queue disabled. |