IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to send just 10 rows in a CICS screen from DB2 table


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Megha Gupta

New User


Joined: 15 Mar 2012
Posts: 5
Location: India

PostPosted: Thu Feb 23, 2017 6:57 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 23, 2017 7:23 pm
Reply with quote

One way would be through BMS paging.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 08, 2017 5:12 pm
Reply with quote

@ 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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Mar 08, 2017 5:54 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Mar 08, 2017 8:17 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Mar 08, 2017 8:22 pm
Reply with quote

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 icon_smile.gif but I concur 1000 pages is a bad idea but TS should be good with TS logic.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top