deleting a single record from a TSQ

Tags:
Development
HELLO, how can i delete a single record from a TSQ.please help. thank you

Answer Wiki

Thanks. We'll let you know when a new response is added.

In order to delete a record from a temporary storage queue, you need to know what the key of the temp storage record is as well as the value of the key for the record you want to delete.

Generally you want to issue a handle condition to take charge if the queue ID you attempt to read/delete from is invalid. Then you need to set the values in the working storage fields associated with the action. Next you do a READQ TS followed by a DELETEQ TS. See the example below…

EXEC CICS HANDLE CONDITION
QIDERR (Z300-ERROR)
END-EXEC.
*** We use the terminal id and trans id as the key ***
MOVE WD-COMM-TERM-ID TO TS-TEMP-STOR-TRM-ID.
MOVE ’12AA’ TO TS-TEMP-STOR-TRN-ID.

EXEC CICS READQ TS
QUEUE (TS-TEMP-STOR-QUEUE)
INTO (TS-TEMP-STORAGE-RECORD)
LENGTH (WS-TEMP-LENGTH)
END-EXEC.

EXEC CICS DELETEQ TS
QUEUE (TS-TEMP-STOR-QUEUE)
END-EXEC.

Storage queue record area in working storage looks like this:

01 TS-TEMP-STORAGE-RECORD.
05 TS-TEMP-STOR-QUEUE.
10 TS-TEMP-STOR-TRM-ID PIC X(04).
10 TS-TEMP-STOR-TRN-ID PIC X(04).
05 TS-PROG-ID-FROM PIC X(08).
05 TS-SAVE-RQ-PAGE-FRWD PIC X(91).
05 TS-SAVE-RQ-PAGE-FRST PIC X(91).
05 TS-SAVE-RQ-PAGE-SCROLL PIC X(91).
05 TS-SCROLL-TO PIC X(01).
05 TS-END-OF-DATA PIC X(01).
05 TS-NO-DATA-AVAIL PIC X(01).
05 TS-SAVE-PG-NO PIC 9(03).
05 TS-OPEN-SCREEN-SW PIC X(01).
88 TS-OPEN-SCREEN VALUE ‘Y’.
05 TS-DATA.
10 TS-DATA-TABLE OCCURS 8 TIMES.
15 TS-DATA-AREA OCCURS 2 TIMES.
20 TS-PROP-BRAND-CD PIC X(06).
20 TS-PROP-BRAND-DS PIC X(25).
05 TS-SWITCH-TABLE.
10 TS-UPDATE-SWITCHES-TABLE OCCURS 8 TIMES.
15 TS-UPDATE-SWITCHES OCCURS 2 TIMES.
20 TS-UPDATE-SW PIC X(01).

Hope this help you out.

Regards,

Jim

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following