IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Code needed for deleting 10th item in a TSQ


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Sun Nov 20, 2005 3:01 pm
Reply with quote

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
View user's profile Send private message
KMK

New User


Joined: 29 Jul 2005
Posts: 18

PostPosted: Mon Nov 21, 2005 12:48 pm
Reply with quote

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
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Mon Nov 21, 2005 2:34 pm
Reply with quote

Hi KMK,

Thanks for your reply...
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Mon Feb 25, 2008 1:20 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 25, 2008 4:29 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Feb 25, 2008 4:50 am
Reply with quote

dick scherrer wrote:
If i misunderstand, please let me know.
Same for me, but, Dick, are you thinking TD queues....?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 25, 2008 6:57 am
Reply with quote

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
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Mon Feb 25, 2008 11:38 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Deleting a Tape file JCL & VSAM 14
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts CA7 deleting files in steps after job... CA Products 4
Search our Forums:

Back to Top