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

Achieve paging logic without TSQ


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

New User


Joined: 20 Apr 2009
Posts: 14
Location: Bangalore

PostPosted: Fri Apr 29, 2011 11:06 am
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: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Apr 29, 2011 12:49 pm
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: 6966
Location: porcelain throne

PostPosted: Fri Apr 29, 2011 2:16 pm
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: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Apr 29, 2011 2:43 pm
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: 6966
Location: porcelain throne

PostPosted: Fri Apr 29, 2011 4:27 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 29, 2011 4:49 pm
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: 6966
Location: porcelain throne

PostPosted: Fri Apr 29, 2011 8:09 pm
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: 6966
Location: porcelain throne

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

GUY_C made a post today
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: 14
Location: Bangalore

PostPosted: Tue May 24, 2011 6:18 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts CA7 late paging for a demanded job CA Products 2
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
This topic is locked: you cannot edit posts or make replies. Need assistance in job scheduling logic. Mainframe Interview Questions 2
No new posts Rexx Logic error while adding seperat... CLIST & REXX 3
No new posts PL/1 Callback address logic in z/OS C... PL/I & Assembler 1
Search our Forums:

Back to Top