| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| syam Beginner
 
  
 Joined: 14 May 2006
 Posts: 22
 Topics: 7
 Location: INDIA
 
 | 
			
				|  Posted: Wed Sep 13, 2006 9:50 am    Post subject: Accessing Last But one element of TSQ |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| smile_rajeev Beginner
 
 
 Joined: 28 Oct 2005
 Posts: 14
 Topics: 9
 
 
 | 
			
				|  Posted: Tue Sep 19, 2006 5:31 am    Post subject: Accessing last but one element of TSQ |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| syam Beginner
 
  
 Joined: 14 May 2006
 Posts: 22
 Topics: 7
 Location: INDIA
 
 | 
			
				|  Posted: Tue Sep 19, 2006 7:08 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| adarsh444 Beginner
 
 
 Joined: 19 Sep 2006
 Posts: 13
 Topics: 9
 
 
 | 
			
				|  Posted: Sat Sep 23, 2006 7:34 pm    Post subject: |   |  
				| 
 |  
				| We can also check the number of records in TSQ using CEBR command. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ravikumar_sri2001 Beginner
 
  
 Joined: 06 Dec 2002
 Posts: 117
 Topics: 44
 Location: Chennai,India
 
 | 
			
				|  Posted: Mon Sep 25, 2006 8:17 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		|  | 
	
		|  |