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 

Navigating in 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
bindugs
Beginner


Joined: 13 Oct 2004
Posts: 1
Topics: 1

PostPosted: Wed Oct 13, 2004 5:06 am    Post subject: Navigating in TSQ Reply with quote

Can u provide me with a sample program for Navigating thru a TSQ ?Pageup ,Pagedown logic
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Oct 13, 2004 5:28 am    Post subject: Reply with quote

Bindu_gs,

Check this link which explains in detail about the READQ TS

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHJAP4C/1.150?DT=20030108162734

Check the examples below for a reading a TSQ with an item number. The paging logic can be written by saving the last item number.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Sun Nov 14, 2004 5:52 am    Post subject: Reply with quote

Hi Kolusu,
I have gone through the link which is provided by you. Really it very much useful. I am new the CICS. Please clarify my doubts regarding writing a new CICS Program containing the PageUp/PageDown Logic.

Please check my below assumptions in writing PageUp & PageDown logic in CICS-DB2. If any errors please correct it. [I am new to this kind of logic].

1) We should fetch all the records into TSQ from the Select Statement
(If SELECT returns more number of rows what will happen. Is that TSQ is self expandable?)

2) Then read TSQ record by record until the ASSUMED-PAGE-RECCOUNT =
TSQ-READCOUNT and send the map to the terminal.

3) Before sending the map to the terminal store the last key read from the TSQ in any hostlanguage variable.
(Where we should store this Last Key Read. Because CICS terminates the transaction as soon as the map shown on the screen. I feel the value present in the hostlanguage variable-last key read also will be lost.)

(OR)
If user presses PageDown-Send the KEY of the Last Row shown on the MAP to the program again to retrieve the next records. And read the TSQ from the last key onwards

5) If user presses PageUp -> How can we handle it?

6) And also if the user is in the middle of pages. There also PageUp And PageDown logic should work. How can we handle these cases.

I totally confused about this logic. Can you help.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Nov 14, 2004 7:17 pm    Post subject: Reply with quote

ramu_mohan21,

Quote:

If user presses PageDown-Send the KEY of the Last Row shown on the MAP to the program again to retrieve the next records. And read the TSQ from the last key onwards


Yes you are absolutely right. Take the last record of the map and retrieve the records GREATER than that key.

Quote:

If user presses PageUp -> How can we handle it?


Same as pagedown logic but instead of the last key of the map , you will store the FIRST key of the map and retrieve records which are LESS than the first key

Quote:

And also if the user is in the middle of pages. There also PageUp And PageDown logic should work. How can we handle these cases.


what exactly do you mean of the middle of the pages? let us say the cics map shows 20 records at a time . so you are in the middle in the sense that your cursor is postiioned on records no: 10. Now if you press pagedown key , do you want to show the key 10 as your first key and populate the records 21 thru 29 of the tsq as the map records 11 thru 20?

If that is the case then you need to store the key based on your cursor position and follow the same logic as pagedown and pageup.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Wed Nov 24, 2004 5:54 am    Post subject: Reply with quote

Hi Kolusu,
I'm sorry for responding very late. In the middle of the pages means
A) If there are 10 pages of data to be retrieved. Then user is in 5 page. He should be able to go to 4,3,2,1 as well as 6,7,8,9,10.
As you suggested, I think this can be handled by storing the first key and last key of the map and reading the TSQ accordingly. Am I right?

But here I have doubt that- First Key and Last key will be stored in the Host Language Variables before sending the Map (or) After sending the Map. Please can you clarify.

B) If the page consisting of 10 records and the user kept the cursor at the 5th record and pressed PageDown key. Then that record should become as the first record of the page. I mean relocation of the record. How it can be handled. Because the user is pressing the key by keeping the cursor at a perticular record within the page dynamically.

Kolusu,
If I am not clear and you didn't understand what I mean to say, please let me know. I will reply with some examples.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Fri Nov 26, 2004 10:58 am    Post subject: Reply with quote

You don't want to use the data keys to keep track of screen postiions, you need to use the TSQ item numbers instead, since you can't address the TSQ by data key, only by item number. If you have for example 10 items per page, then TSQ items 1-10 would be read to display a full page, items 11-20 for the next full page etc.
You only need to keep track of the current top of page item number. You can pass the current value of this field from transaction to transaction via the COMMAREA in the normal way.

A) You will need something like a page number field on your map for this. Then you can calaculate a TSQ item number, e.g. the user types 7 in the page number field, you have 10 items per page, then the top of page item number is 10*7+1 = 71
So you read and display by item number a page full of TSQ items starting from item 71.

B) You can use the EIBCPOSN field to get the cursor position and from this you can calculate what line number it was on and add this offset to the current top of screen item number to calculate the new top of screen item.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 29, 2004 6:22 am    Post subject: Reply with quote

Hi,
There is a sample code available here.just download it and have a look.
http://www.murach.com/books/cdrf/index.htm
Back to top
View user's profile Send private message
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Tue Nov 30, 2004 6:08 am    Post subject: Reply with quote

Hi Mike and Kiran,
Thank you very much for giving me the solutions.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
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