View previous topic :: View next topic
|
Author |
Message |
Megha Gupta
New User
Joined: 15 Mar 2012 Posts: 5 Location: India
|
|
|
|
Hi All,
I have a CICS-DB2 program. in which i have to select some data from DB2 table and if suppose i fetch 10000 rows from table satisfying the sql query. Now,
1- How to send this data to CICS screen
2- I want to see just 10 rows on my CICS screen at once. next 10 rows at next screen and so on..
please let me know the idea on the solutions of the above problems.
Best Regards,
Megha |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
One way would be through BMS paging. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ Megha Gupta
Just because i have some spare time.
declare-cursor
open-cursor
Loop-Start
fetch-Cursor
move to map until 10
send-map
Loop-End
close-cursor
Also include some Pf-Key handling for the paging, forward,backward, ...
as Robert told you.
But looking at your Profile: joined 2012, Cobol, Cics,DB2 - it makes one think. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
You should dump all the rows to a temp queue and release all db2 resources and then do a simple paging logic based on the stored item #. If the queues are updatable then enq it first.
Find existing screens which has this facility and look how its is done and clone it. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Fetching and storing up to 10000 rows may lead to bad response times, which is... not good.
Some sites may even limit the number of DB2 accesses by a task.
With 10 rows a pages, you can have up to 1000 pages. That's a lot of Temporary Storage.
As I doubt that anybody will ever reach page 100 by pressing 99 times on PF8, that's a lot of wasted storage.
What would I do ?
1. Find in the table a "continuation key", one that would allow to "restart" a cursor at a different place.
2. Fetch 10 rows, save them in a TS Item and display them on screen.
3. If the user presses PF8, open the cursor using the "continuation key" to reposition it after the last row of previous page. Return to step 2.
4. If the user presses PF7, just reload data from previous item in TS and display. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Quote: |
With 10 rows a pages, you can have up to 1000 pages. That's a lot of Temporary Storage.
As I doubt that anybody will ever reach page 100 by pressing 99 times on PF8, that's a lot of wasted storage.
|
Unless they have a slot to enter page# on the screen but I concur 1000 pages is a bad idea but TS should be good with TS logic. |
|
Back to top |
|
|
|