|
But wouldn't you use the dynamic sort if you did it that way? Thanks, Mark Mark Walter Sr. Programmer/Analyst Hanover Wire Cloth a div of CCX, Inc. mwalter@hanoverwire.com http://www.hanoverwire.com 717.637.3795 Ext.3040 "Peter Dow" <pcdow@yahoo.com> To: <rpg400-l@midrange.com> Sent by: cc: rpg400-l-admin@mi Subject: Re: Position To in a display file pgm using embedded sql drange.com 10/28/01 12:52 PM Please respond to rpg400-l Hi Phil, Oops, I misunderstood the question. Hmm, I see what you mean. To page up from the first page of your record set, you'd have to have a select <=, then fetch *last followed by fetch *prior. Sounds messy. You're right, a fetch by key would be nice -- select the entire record set, then fetch by key to position within it. You could probably cobble something like that together by loading a user index based on the entire record set, then loading the subfile from that. By putting all the busy work in procedures the main code wouldn't be too bad. But it sounds like this is a case where Joe Pluta's correct - building a logical file and using native i/o (setll, read, readp) seems simpler, faster and cleaner. Regards, Peter Dow Dow Software Services, Inc. 909 425-0194 voice 909 425-0196 fax From: "Phil" <sublime78ska@yahoo.com> > Peter, > > That is how I handle page-up normally. > > The problem I'm having is that inorder to do a PositionTo I have to include > a where clause on the select statement: > > C eval @select1 = > C 'select * from rbsurchgp + > C where rbcco = ' + %editc(cpy:'X') > C if PosToInd = *on > C eval @select1 = @select1 + > C ' and rbccus >= ' + %editc(posToCus:'X') > C endif > C eval @select1 = @select1 + > C ' order by rbcco, rbccus ' > C > > If the user presses the F-key to bring up the position-to window, and > doesn't press cancel, I set on an indicator (PosToInd) and then add the > where clause. > > Now the cursor contains records >= to the position-to value. So what I'm > looking for is another way to position-to. What I want is a fetch relative > where I can use the key rather than a rrn. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.