|
In the control record. You can chose to enter "Records in subfile" or name
a field in "Program-to-system field" by putting an "8" as the option in
SDA. If you use program-to-system field you must define the field in the
control records dspecs. You will create this field just as you would for a
hidden field but instead of using an H, you would use a P. The biggest you
can define this field is 5, 0 (it may be the only size that you can
specify).
Define Display Layout
Subfile control record . . . . . . . . . : C1
Type values, press Enter.
Keyword Number
Records in subfile . . . . . . . . . . SFLSIZ
Program-to-system field . . . . . . SFLSIZE
Records per display . . . . . . . . . SFLPAG 14
Spaces between records . . . . . . . . SFLLIN
F3=Exit F12=Cancel
Once you've specified the field in the screen above put a 12 on the control
record to edit the screen. Then press F4 to work with fields. You will see
this screen.
Work with Fields
Record . . . : C1
Type information, press Enter.
Number of fields to roll . . . . . . . . . . . . . . . . . . 6
Type options, change values, press Enter.
1=Select keywords 2=Edit comments 4=Delete field
Option Order Field Type Use Length Row/Col Ref Condition
Overlap
10 MYSFLRRN S P 5,0
20 *DATE C 6,0 01 002
30 *TIME C 6,0 01 013
40 SDPROGRAM A O 10 01 059
50 SFLRRN S H 5,0
60 RECLOC A H 10
More...
Add H Hidden
Add M Message
Add 10 sflsize P 5,0 Program-to-system
F3=Exit F6=Sort by row/column F12=Cancel
You see in the bottom,I've entered a program to system field with the same
name as I used above.
In the RPG program, you will then Eval SFLSIZE = *HIVAL or 99999
Alan Shore
<AlanShore@xxxxxx
om> To
Sent by: RPG programming on the AS400 /
rpg400-l-bounces@ iSeries <rpg400-l@xxxxxxxxxxxx>
midrange.com cc
Subject
08/03/2006 12:35 Re: Even more embedded SQL....
PM Thank you EVERYBODY (one last
thing)
Please respond to
RPG programming
on the AS400 /
iSeries
<rpg400-l@midrang
e.com>
Michael - as William Shakespear once said
"What The @#$%^& are you talking about?"
Could you be more explicit.
Are you saying that there is a way to load 99,999 records to a load all
sub-file?
Please (and I stress please) be more forthcoming
Alan Shore
NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
Michael_Schutte@b
obevans.com
Sent by: To
rpg400-l-bounces@ RPG programming on the AS400 /
midrange.com iSeries <rpg400-l@xxxxxxxxxxxx>
cc
08/03/2006 12:27 Subject
PM Re: Even more embedded SQL....
Thank you EVERYBODY (one last
thing)
Please respond to
RPG programming
on the AS400 /
iSeries
<rpg400-l@midrang
e.com>
I believe that you can use a program-to-system field that will allow you to
create 99,999 records.
Alan Shore
<AlanShore@xxxxxx
om> To
Sent by: RPG programming on the AS400 /
rpg400-l-bounces+ iSeries <rpg400-l@xxxxxxxxxxxx>
michael_schutte=b cc
obevans.com@midra
nge.com Subject
Re: Even more embedded SQL....
Thank you EVERYBODY
08/03/2006 12:25
PM
Please respond to
RPG programming
on the AS400 /
iSeries
<rpg400-l@midrang
e.com>
Booth - you and I must be on the same wavelength, or in mutual mind-meld
mode or something.
I want to take time to thank everyone who has replied to my question, with
suggestions, ideas, thoughts, other questions and especially examples.
I think I have a handle on everything that I need in relation to what is
required for SQL and Dynamic sort building, but what bothers me is the
position to aspect of SQL, where the file data is rebuilt, with the first
record being equal to or greater than the value that was requested to be
positioned to. The problem of paging up from that point (before the first
record) will mean yet another re-creation.
So I was thinking of a couple of things
1/. Load the first 9,999 records into a load all sub-file.
If the user wants to go above that, recreate the data and load the next
9,999 records etc. etc.
If the user wants to position to a value AND its within this 9,999 NO
PROBLEM
If its outside the range , recreate the data and load the applicable 9,999
records into the sub-file.
2/. Create a file (via DDS) with all the fields defined
COL1, COL2, COL3, COL4, COL5, COL6, COL7 and an additional field which is
in effect equal in size to ALL the fields CONCATENATED. This field would
now be the key of the file, and depending upon what sort is required, build
this field accordingly
for example
if the sort is COL1, COL2, COL3, COL4, COL5, COL6, COL7, the this key field
is created as
COL1 concat COL2 concat COL3 concat COL4 concat COL5 concat COL6 concat
COL7
and then use regular RPG to handle the page up, page down, position to
page-at-a-time sub-file
Anybody any thoughts on either of these 2 ideas?
Alan Shore
NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
Booth Martin
<booth@xxxxxxxxxx
om> To
Sent by: RPG programming on the AS400 /
rpg400-l-bounces@ iSeries <rpg400-l@xxxxxxxxxxxx>
midrange.com cc
Subject
08/03/2006 11:40 Re: Even more embedded SQL....
AM
Please respond to
RPG programming
on the AS400 /
iSeries
<rpg400-l@midrang
e.com>
May I make a suggestion here?
A small, but very helpful step might be to put filters in place before
the process starts, or at any time in the process. Let the user set the
filters with an F-key. Point out to the users the problems it solves
for them, and I believe they will get on board. "I want all of zip code
12345 sorted by color" becomes a breeze to do.
If they will filter so that the number of records of interest remains
below about 2500 records then you can do a load-all into an array and
the sorting becomes a piece of cake. Heck, it even allows a scroll bar,
which really is wonderful if for no other reason than that they can pull
the subfile up or down one record at a time with no coding required on
your part. (Yes, thats right. One record at a time up or down. Piece
of cake.)
Alan Shore wrote:
That's one thing I'm still playing around with in my head. I've talked
with
the user, and even he's not sure what he wants here. I'm leaning more towards starting from the beginning of the file (No
matter
how its sorted, for each RE-SORT)as I'm pretty sure this will be easier
to
code for. Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxx
Booth Martin
<booth@xxxxxxxxxx
om>
To
Sent by: RPG programming on the AS400 /
rpg400-l-bounces+ iSeries <rpg400-l@xxxxxxxxxxxx>
alanshore=nbty.co
cc
m@xxxxxxxxxxxx
Subject
Re: Even more embedded SQL....
08/03/2006 10:40
AM
Please respond to
RPG programming
on the AS400 /
iSeries
<rpg400-l@midrang
e.com>
So, then, when the user clicks on the other column, say color, will the first record of the new subfile be the first record of the field value in record 1 of the subfile? Lets say I have a subfile sorted by year and the first displayed record happens to have a value of "White" in the color column. When I click the color column does my new subfile start with "White" or with the lowest color alpha value, say... "Amaretto" or "Blue" or "Cyan"? Alan Shore wrote:Thanks Booth The answer is for the WHOLE data (ALL 15,000 records) to be sorted (ascending/descending) based upon whatever combination of the 7 columnstheuser wants, hence the Dynamic sort. The order by of the SQL statementwillhave to be dynamically built. Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxxBooth Martin<booth@xxxxxxxxxxom>ToSent by: RPG programming on the AS400 /rpg400-l-bounces@ iSeries <rpg400-l@xxxxxxxxxxxx>midrange.comcc Subject08/03/2006 10:21 Re: Even more embedded SQL....AMPlease respond toRPG programmingon the AS400 /iSeries<rpg400-l@midrange.com>What if you present data by, say, year. Then the user clicks the column headed "Color". Do you want the 15 items shown by column "year" to be sorted by color, or so you want all 15000 records sorted by color first, then by year? (Also, clicking the sort column a second time could present the same data in reverse order (ascending vs. descending) Alan Shore wrote:Thanks for your reply Michael, but I think you misunderstand what I am looking for. If my screen is displaying 7 different columns, the user wants to beableto sort the data by ANY combination of those columns for example Col1, Col2, Col3, Col4, Col5, Col6, Col7 and then (by magic) the same data by Col7, Col6, Col5, Col4, Col3, Col2, Col1 AND THEN Col6 Or maybe Col5, Col6, Col1 This would mean building the ORDER BY within the SQL statement baseduponthe request of the user. So as per my original request if anyone can help me, I am looking for an example of embedded SQL and Dynamic Sorting Subfiles - Page at a time (with the ability to position to a particular piece of data) However - Michael, I will still look up your suggestion Thanks in advance Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxx Michael_Schutte@b obevans.com Sent by:Torpg400-l-bounces@ RPG programming on the AS400 / midrange.com iSeries <rpg400-l@xxxxxxxxxxxx>cc08/03/2006 09:53SubjectAM Re: Even more embedded SQL....Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com>Look in the archives for uses of the CASE statement. I don't remembertheexact syntax at this time, but you can use the case statement to orderbyaspecific field based on the user selection. Alan Shore <AlanShore@xxxxxx om>ToSent by: RPG programming on the AS400 / rpg400-l-bounces@ iSeries <rpg400-l@xxxxxxxxxxxx> midrange.comccRPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>, 08/03/2006 09:53 rpg400-l-bounces@xxxxxxxxxxxx AMSubjectEven more embedded SQL.... Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> Hi All, I have been given a project that requires the need to display, withinasubfile, the data from 2 separate files with the ability to sort that data from any number of different columns. So I thought to myself, this smacks of embedded SQL and Dynamic Sorting Subfiles. The unfortunate thing is that the data I have to display is over 15,000 records long(andgrowing) so if anyone can help me, I am looking for an example of embedded SQL and Dynamic Sorting Subfiles - Page at a time (with the ability to position to a particular piece of data)" Some title for an article huh? If anyone has an example of what is required, or could point me in some direction, I would be very grateful. Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxx -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailinglistTo post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailinglistTo post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.-- ----------------------------- Booth Martin www.martinvt.com ----------------------------- -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailinglistTo post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.-- ----------------------------- Booth Martin www.martinvt.com ----------------------------- -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
-- ----------------------------- Booth Martin www.martinvt.com ----------------------------- -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx 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-2025 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.