Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 8117
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: 755
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: 1736
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: 1232
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: 1736
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 Loading data to table gives wrong for... Raghu navaikulam DB2 16 Thu Jul 13, 2017 2:11 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us