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
 

 

Want to delete the contents of TSQ, not queue.

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

New User


Joined: 22 Feb 2010
Posts: 5
Location: Bangalore

PostPosted: Wed Feb 24, 2010 7:44 pm    Post subject: Want to delete the contents of TSQ, not queue.
Reply with quote

Hi All,

I need to delete the contents of TSQ so that I can re-write to the queue again with no contents in it. However, I dont want to delete the queue. Just want to clear the TSQ (clear the contents in TSQ). How can I achieve it?
Back to top
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 24, 2010 8:01 pm    Post subject:
Reply with quote

Hi chaitrasmurthy,

Your question seems to be pretty straightforward. If you have tried using TSQ certainly you would have seen the DELETEQ TS command.

Wouldn't that achieve your requirement ?

Please have look into the manuals for more details.
Back to top
View user's profile Send private message
chaitrasmurthy

New User


Joined: 22 Feb 2010
Posts: 5
Location: Bangalore

PostPosted: Wed Feb 24, 2010 8:17 pm    Post subject: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

Well, if DELETEQ TS deletes only the contents of TSQ, then how do we delete the TSQ itself?

Ex - Say, I have TSQ 'SAMPLE'. My requirement is to write some contents into TSQ and on execution of a particular command say CLEAR, I need to delete the contents of TSQ and start writing into the queue, the data for the next commands issued by the user. At the end of the transaction, I need to delete the queue (Mean to say, I shouldnt have any queue by name 'SAMPLE').

So, I need to perform 2 operations on whole, just delete the contents of TSQ at some stage and at the end delete TSQ itself. May I know which purpose out of the two will be served by using DELETEQ TS?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 24, 2010 8:20 pm    Post subject: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

The only way you could do this and save the current TSQ, would be to determine whether the TSQ only has one ITEM/RECORD (via the READQ TS API NUMITEMS halfword). If this is true, then you can re-initialize this single ITEM to a chosen value (such as LOW-VALUES), followed by a REWRITE.

Otherwise, follow Binop's post.

FWIW, the DELETEQ API deletes the entire TSQ itself, not just the contents....

Bill
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 24, 2010 8:28 pm    Post subject:
Reply with quote

Hi chaitrasmurthy

TSQ's are temporary storage queues. and since its temporary (and if my understanding is correct... icon_razz.gif ) functionally there should not be much difference between cleaning up the queue or deleting it. Probably if you tell us how the TSQ is used in other places maybe we might understand your concern.

Also i suggest you could have a re-look into the manual. That might sometimes clear your doubts... icon_smile.gif
Back to top
View user's profile Send private message
chaitrasmurthy

New User


Joined: 22 Feb 2010
Posts: 5
Location: Bangalore

PostPosted: Wed Feb 24, 2010 8:35 pm    Post subject: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

Bill,

For my requirement, I will be writing records from database. So, its just not a single record. TSQ can have many records. Suppose, I already have 20 records in TSQ and once I start re-writing, the next database fetch might only have 10 records. In that case, I ll have 11-20 records which is the result of previous command executed which would be misleading.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 24, 2010 8:37 pm    Post subject: Re: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

Bill O'Boyle wrote:
The only way you could do this and save the current TSQ, would be to determine whether the TSQ only has one ITEM/RECORD (via the READQ TS API NUMITEMS halfword). If this is true, then you can re-initialize this single ITEM to a chosen value (such as LOW-VALUES), followed by a REWRITE.

Otherwise, follow Binop's post.

FWIW, the DELETEQ API deletes the entire TSQ itself, not just the contents....

Bill
Oh... So that's what chaitrasmurthy was trying to do... to keep the records in the queue as such and clear each record... Silly Me !! icon_redface.gif
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 24, 2010 8:42 pm    Post subject: Re: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

chaitrasmurthy wrote:
Bill,

For my requirement, I will be writing records from database. So, its just not a single record. TSQ can have many records. Suppose, I already have 20 records in TSQ and once I start re-writing, the next database fetch might only have 10 records. In that case, I ll have 11-20 records which is the result of previous command executed which would be misleading.
Nope... back to square 1 !!! icon_cool.gif

I think my initial understanding was correct...

@chaitrasmurthy.. I suggest as of now that you do the DELETEQ TS before your "database read and TSQ update" and see how its working. Am pretty much confident now that it will work to your liking... icon_biggrin.gif
Back to top
View user's profile Send private message
chaitrasmurthy

New User


Joined: 22 Feb 2010
Posts: 5
Location: Bangalore

PostPosted: Wed Feb 24, 2010 8:51 pm    Post subject: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

Alright. Thanks for your time. Once I delete the queue and issue a write command, the queue will again be created. So, that should solve my problem.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 24, 2010 8:55 pm    Post subject: Re: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

chaitrasmurthy wrote:
Alright. Thanks for your time. Once I delete the queue and issue a write command, the queue will again be created. So, that should solve my problem.
Exactly... that's how TSQ's work !! icon_smile.gif

Glad that we could be of help..
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 24, 2010 9:15 pm    Post subject: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

Since CICS/OS 1.7 (late 1980's), the CICS folks introduced RESP and/or NOHANDLE to CICS API's.

So, if you're issuing a DELETEQ TS, don't define a HANDLE CONDITION QIDERR as this generates (as all other HANDLE CONDITION API's) an internal CICS GETMAIN.

If you specify NOHANDLE in your DELETEQ TS API, you're informing CICS that you don't care if the TSQ exists or not (and you probably don't) and plus, you'll eliminate the HANDLE CONDITION and the GETMAIN.

Bill
Back to top
View user's profile Send private message
chaitrasmurthy

New User


Joined: 22 Feb 2010
Posts: 5
Location: Bangalore

PostPosted: Wed Feb 24, 2010 10:27 pm    Post subject: Reply to: Want to delete the contents of TSQ, not queue.
Reply with quote

Thanks for the info.
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 JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Delete record or Reset RC code using ... mpawan Compuware & Other Tools 4 Tue Jul 26, 2016 3:52 pm
No new posts Consolidating and summing file contents Kevin Lindsley SYNCSORT 14 Thu Jun 09, 2016 5:24 am
No new posts Delete VSAM File Records amitc23 CICS 6 Sun Apr 10, 2016 10:10 am


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