View previous topic :: View next topic
|
Author |
Message |
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi All,
I have TSQ with 15 items. I want to delete the 10th item. How do I do that? I dunno the exact code to achieve it. Please help me. |
|
Back to top |
|
|
KMK
New User
Joined: 29 Jul 2005 Posts: 18
|
|
|
|
Hi,
If you want to delete the logical 10 th item then
You can execute
EXEC CICS READQ TS
QUEUE (QNAME)
INTO (RDATA)
ITEM(10)
END-EXEC
instruction to get the 10 th item and then
use EXEC CICS DELETEQ TS instruction to delete the 10 th item.
If i am wrong please correct me. |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi KMK,
Thanks for your reply... |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
The code provided by KMK is wrong. The DELETEQ will delete the entire TSQ.
Try this.
Code: |
MOVE LOW-VALUES TO VAR02.
EXEC CICS WRITEQ TS
QUEUE('QNAME1')
FROM(VAR02)
REWRITE
ITEM(10)
END-EXEC. |
If you really want to recover the space of 10nth record, move 11nth record to 10nth record, 12th to 11nth and so on....(?) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe this method could cause more problems that it will provide service.
If you are performing some sort of one-time maintenance, it may work ok, but this is a disaster waiting to happen if it is planned for "regular use".
The pimary concept behind the queue is to work off arrivals serially - not some 'nth' entry. How would the 'nth' positon be maintained?
If i misunderstand, please let me know. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
dick scherrer wrote: |
If i misunderstand, please let me know. |
Same for me, but, Dick, are you thinking TD queues....? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Possibly. . .
For my $.02, i prefer to use a database.
Seems (to me) to be far more flexible, provides nearly automatic restart/recovery (if the application is properly set up), eliminates an additonal "layer" of technology (assuming database is already being used), and allows for more consistent definition of processing resources.
Again, just my $.02. |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
dick scherrer, you are right. There is no need to delete a record from a queue in real world.
I believe this is an interview question. I may be in a situation to permanently delete a record(Aux. TSQ) after I have passed it to you (it may contain some personal info). The only way is, I have to issue a WRITE command with REWRITE before any SYNCPOINT. |
|
Back to top |
|
|
|