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
 

 

Achieve paging logic without TSQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
sjiraga

New User


Joined: 20 Apr 2009
Posts: 13
Location: Bangalore

PostPosted: Fri Apr 29, 2011 11:06 am    Post subject: Achieve paging logic without TSQ
Reply with quote

In my current application we are using TSQ to store DB2 records and later that records are used for displaying on online screen and TSQ is used for paging purpose also.

Now Business analyst want do not want to display from the TSQ and they want to fetch directly from the DB2 talbe. But without that how to achieve paging logic. Please let me know any one without TSQ is there any method to achieve paging logic
Back to top
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1018
Location: Oostende, Belgium

PostPosted: Fri Apr 29, 2011 12:49 pm    Post subject:
Reply with quote

Your BA exhibits the characteristics of a PHB.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Fri Apr 29, 2011 2:16 pm    Post subject:
Reply with quote

actually, a controlled cursor is better than a tsq.
tsq requires extra resources,
and often the entire queue will not be used, so it is a waste to build the que in the first place,
also, delete logic at end of transaction, etc......

maintaining some kind of key, whether it be count or a value that can be used in a where clause,
means that only the data that is required for the screen displayed is retrieved.

and yes, it requires a little more that rookie knowledge to implement.

the BA maybe a PHB, but he knows what he is talking about.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1018
Location: Oostende, Belgium

PostPosted: Fri Apr 29, 2011 2:43 pm    Post subject:
Reply with quote

I tend to disagree. Using a TSQ the right way, i.e. not retrieving all data right at the start, but only when a page-forward operation is requested is far more efficient than constantly going off to DB2 to retrieve data that has already been fetched before.

As for the resources used by a TSQ, if it is used as above and properly deleted at the end of the transaction, the overhead will be pretty minimal.

The only time you might not be using a TSQ would be the case where the underlying DB2 table is extremely volatile, although in this case a simple "RESFRESH" command could easily be added to the application.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Fri Apr 29, 2011 4:27 pm    Post subject:
Reply with quote

Quote:
DB2 to retrieve data that has already been fetched before.


well, that will happen if you are a rookie.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Fri Apr 29, 2011 4:49 pm    Post subject: Reply to: PAGING LOGIC
Reply with quote

from the TAO of programming

Quote:
A program should follow the `Law of Least Astonishment'. What is this law? It is simply that the program should always respond to the user in the way that astonishes him least.


accessing the database and paging thru temporary storage will follow the abovesaid rule

not so much paging thru database access
( think of backward paging if a <something> has been modified )
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Fri Apr 29, 2011 8:09 pm    Post subject:
Reply with quote

with appropriate where clauses,
you can control your result set
so that it only returns what you need for the current screen.

then you do not have to deal with legecy tsq crap.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Sat Apr 30, 2011 1:51 am    Post subject:
Reply with quote

GUY_C made a post today
http://ibmmainframes.com/viewtopic.php?p=266811#266811
that would provide basis as a solution
to satisfy even the most hairbrained attempt to 'prove'
that sometimes just gotta use a TSQ.

never had to do it with VSAM,
now DB2 is becoming sophisticated to the point,
you don't need TSQ's to save display data.

There are plenty of good reasons to use TSQ's,
screen paging in this day and age just ain't oneadem
Back to top
View user's profile Send private message
sjiraga

New User


Joined: 20 Apr 2009
Posts: 13
Location: Bangalore

PostPosted: Tue May 24, 2011 6:18 pm    Post subject: Thanks for everyone who shares their knowldge.. Sorry I have
Reply with quote

Thanks afor everyone who shares their knowldge. Sorry I have not replied immediately my feedback.
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 Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm
No new posts Tricky sort logic required pgopi92 DFSORT/ICETOOL 3 Mon Jan 25, 2016 3:29 pm


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