MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing Last But one element of TSQ

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
syam
Beginner


Joined: 14 May 2006
Posts: 22
Topics: 7
Location: INDIA

PostPosted: Wed Sep 13, 2006 9:50 am    Post subject: Accessing Last But one element of TSQ Reply with quote

Hi,
Can we access last but one element ((n-1)th element) of TSQ,
I am not sur of the number of elements a TSQ contains.






Regards
_________________
S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN
Back to top
View user's profile Send private message Visit poster's website
smile_rajeev
Beginner


Joined: 28 Oct 2005
Posts: 14
Topics: 9

PostPosted: Tue Sep 19, 2006 5:31 am    Post subject: Accessing last but one element of TSQ Reply with quote

hi syam,
GEnerally TSQ contains number of items u write in the Queue using a EXEC CICS
WRITEQ TS command
If u want to read the N-1 th item in the queue which is already written.then
First read the Number of Items in the queue until Itemerr occurs
ie..WS-RESP = DFHRESP(ITEMERR)
Update the each item value in the working storage section variable.
When item error occurs u can find the number of items in the TSQ. Decrementing the value of WS variable .u could again read the TSQ for
N-1 element from the queue.

I haven't tried, but i hope this is also a way to proceed with.

Othwise, if u haven't written the queue yet then fix a variable and each and every write incement the value of Ws variable. After writing all the records in the queue, u get the actual number of items from the working storage varible value.


Rajeev
Back to top
View user's profile Send private message
syam
Beginner


Joined: 14 May 2006
Posts: 22
Topics: 7
Location: INDIA

PostPosted: Tue Sep 19, 2006 7:08 am    Post subject: Reply with quote

We can proceed in In this way, looks quite ok ,If no other better way is available we can proceed in this way
_________________
S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN
Back to top
View user's profile Send private message Visit poster's website
adarsh444
Beginner


Joined: 19 Sep 2006
Posts: 13
Topics: 9

PostPosted: Sat Sep 23, 2006 7:34 pm    Post subject: Reply with quote

We can also check the number of records in TSQ using CEBR command.
Back to top
View user's profile Send private message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Mon Sep 25, 2006 8:17 am    Post subject: Reply with quote

There is a option called "NUMITEMS" in READQ/WRITEQ commands. This will give you number of items in the TSQ.

Hope this helps.

Thanks,
Ravikumar.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group