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

Want to delete the contents of TSQ, not queue.


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 24, 2010 8:20 pm
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
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
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
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
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
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 24, 2010 9:15 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts MQ response when MQGET of a stopped q... Java & MQSeries 2
No new posts IOF Output Queue & REXX(?) All Other Mainframe Topics 2
Search our Forums:

Back to Top