| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| 614mobile Beginner
 
 
 Joined: 19 Jun 2004
 Posts: 3
 Topics: 2
 Location: Bayville, NY
 
 | 
			
				|  Posted: Sat Jun 19, 2004 5:25 pm    Post subject: CICS DB2 Browse |   |  
				| 
 |  
				| Hey Guys, 
 I am working on a CICS/DB2 project and am a novice to both.  I would like to have your opinion on what would be considered an industry standard way for a CICS Cobol program to browse rows from a DB2 table?  Basically what is the right way to scroll forward and backward through rows of data from a single table? I am sure I could struggle through this by opening a cursor and then fetching the number of rows that I need for the first screen and then storing the beginning and ending Keys.  Scrolling forward would just mean fetching additional rows.  Going back?  Re-open the cursor using the last stored beginning key? That seems bogus.  Or should I use a temporary storage queue and use the CICS READNEXT and READPREV? Set me straight.  I can take it. Thanks.
 
 Karen
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| karthikeyan Beginner
 
  
 Joined: 29 May 2004
 Posts: 16
 Topics: 4
 Location: chennai
 
 | 
			
				|  Posted: Sat Jun 19, 2004 6:52 pm    Post subject: |   |  
				| 
 |  
				| hi 614 you can use both the tables and temporary storage queue for this.but its best to use the temporary storage queue and the easy way is you count the no of records present in the tsq whil writing in the tsq itself.cics provides you with an option for counting the number of records.
 the procedure to write into tsq is
 startbr
 deleteq
 readnext
 writeq
 -here u have the numitems(dataname) for getting the total number of records written in a queue.
 endbr.
 then u can scroll front or backwards using the f7 and f8 kes by getting the start item and end item.
 i think this information is helpful for u
 from
 karthik
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| 614mobile Beginner
 
 
 Joined: 19 Jun 2004
 Posts: 3
 Topics: 2
 Location: Bayville, NY
 
 | 
			
				|  Posted: Sat Jun 19, 2004 8:07 pm    Post subject: |   |  
				| 
 |  
				| Karthik, 
 Thank you very much.  I appreciate the quick response and look forward to trying this out.
 
 Karen
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Mike Chantrey Intermediate
 
 
 Joined: 10 Sep 2003
 Posts: 234
 Topics: 1
 Location: Wansford
 
 | 
			
				|  Posted: Mon Jun 21, 2004 9:33 am    Post subject: |   |  
				| 
 |  
				| STARTBR, READNEXT, READPREV and ENDBR are VSAM file commands. They do not apply to TSQs. 
 The only command for reading TSQ items is READQ TS, on which you either specify ITEM to get a specific item number or NEXT to read the next item in sequence. You can jump forward and backwards just by setting the item number to the desired value.
 
 Make sure that your TSQ name is unqiue (e.g. by including the terminal id in it).
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Anand_R Intermediate
 
  
 Joined: 24 Dec 2002
 Posts: 189
 Topics: 60
 
 
 | 
			
				|  Posted: Tue Jun 22, 2004 4:07 am    Post subject: |   |  
				| 
 |  
				| Hi, 
 There is verygood example inCICS program guide for cobol programmers(Murach's addition, part1 & 2 together). You can use as it is. TS queue concept has been used to handle the DB2-CICS browse and also presented efficient tehcniques for performance improvement.
 
 Thanks
 Anand
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Manas Biswal Intermediate
 
  
 Joined: 29 Nov 2002
 Posts: 382
 Topics: 27
 Location: Chennai, India
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |