Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to send just 10 rows in a CICS screen from DB2 table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: how to send just 10 rows in a CICS screen from DB2 table
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: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Thu Feb 23, 2017 7:23 pm    Post subject: Reply to: how to send just 10 rows in a CICS screen from DB2 table
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: 757
Location: Germany

PostPosted: Wed Mar 08, 2017 5:12 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Wed Mar 08, 2017 5:54 pm    Post subject:
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: 1243
Location: Israel

PostPosted: Wed Mar 08, 2017 8:17 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Wed Mar 08, 2017 8:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us