Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Code needed for deleting 10th item in a TSQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
iknow

Active User


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

PostPosted: Sun Nov 20, 2005 3:01 pm    Post subject: Code needed for deleting 10th item in a TSQ
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    Post subject:
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: 413
Location: Colarado, US

PostPosted: Mon Nov 21, 2005 2:34 pm    Post subject: Re: Code needed for deleting 10th item in a TSQ
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    Post subject:
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

Site Director


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

PostPosted: Mon Feb 25, 2008 4:29 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Mon Feb 25, 2008 4:50 am    Post subject:
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

Site Director


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

PostPosted: Mon Feb 25, 2008 6:57 am    Post subject: Reply to: Code needed for deleting 10th item in a TSQ
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us