× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: 4 - subfiles
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Fri, 05 Nov 99 22:21:12 +1100


Hello Booth,

Well, assuming that your users will sort on multiple fields frequently AND that 
they 
will want to view most of the data, I'd load a single array and sort it four 
ways.  
Simply load the subfile from the array -- I'd still use the page at a time load 
method 
to reduce overall response time.

Something like:

D               DS
D SflData                       52A     DIM(999)
D  LastName                     20A     OVERLAY(SflData)
D  FirstName                    20A     OVERLAY(SflData:*NEXT)
D  ExtNbr                        3P 0   OVERLAY(SflData:*NEXT)
D  DeptName                     10A     OVERLAY(SflData:*NEXT)
D I             S                5P 0   INZ(0)

C               READ    DATA
C               DOW     I <= %DIM(SflData) *AND *NOT %EOF
C               EVAL    I = 1
C               EVAL    LastName(I) = LNAM
C               EVAL    FirstName(I) = FNAM
C               EVAL    ExtNbr(I) = EXTNNO
C               EVAL    DeptName(I) = DPTNAM
C               READ    DATA
C               ENDDO

 * User requested sort by last name
C               SORTA   LastName
 * User requested sort by first name
C               SORTA   FirstName
 * User requested sort by Extension number
C               SORTA   ExtNbr
 * User requested sort by Department name
C               SORTA   DeptName

Read the file in arrival sequence, use a large blocking factor, and it will 
perform 
acceptably.  The inital call to the program will require the array to be fully 
populated but it will be faster than loading four subfiles or loading the 
subfile 
completely each time the user changes the sort criterion.

I am sure you can restructure the DS and array to avoid loding the elements 
individually but I don;t have a 400 available at present to test it.  Still, 
this 
should give you something to play with.

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»

-Mailer: Lotus Notes Release 5.0.1 July 16, 1999
Date: Wed, 03 Nov 1999 21:08:31 -0500
From: boothm@earth.goddard.edu
To: midrange-l@midrange.com
Reply-To: MIDRANGE-L@midrange.com
Cc: none
Subject: 4 - subfiles

ere's a subfile question.  I'm not very good with them.  I have a display 
screen showing a subfile with 4 fields.  Each field is the key to a 
logical file so there are 4 logical files in the F-specs.  For clarity, 
lets call the fields LastName, FirstName, ExtNbr, DeptName.  I want the 
user to be able to display any one of the 4 logical files.  I know the 
file will never grow beyond 999 because the ExtNbr field is 3/0, and 
because there's only about 150 extensions now, anyway.   Every time the 
user selects another logical to display I clear the subfile and  reload 
the entire file to the subfile.  With a dozen test records I'm getting 
sub-second reloads.  Now, as the number of records increases it seems to 
me that reload times will increase.  Still, I know that 5000 records load 
in 11 or 12 seconds so the time for about 200 records will probably be a 
second or two.

However, it occurs to me that having loaded the subfile, I shouldn't need 
to read the data file again.  I am thinking there must be an easy way to 
save the subfile in case it is needed again, instead of just clearing it, 
or am I tilting at windmills?

Here's a subfile question.  I'm not very good with them.  I have a display screen showing a subfile with 4 fields.  Each field is the key to a logical file so there are 4 logical files in the F-specs.  For clarity, lets call the fields LastName, FirstName, ExtNbr, DeptName.  I want the user to be able to display any one of the 4 logical files.  I know the file will never grow beyond 999 because the ExtNbr field is 3/0, and because there's only about 150 extensions now, anyway.   Every time the user selects another logical to display I clear the subfile and  reload the entire file to the subfile.  With a dozen test records I'm getting sub-second reloads.  Now, as the number of records increases it seems to me that reload times will increase.  Still, I know that 5000 records load in 11 or 12 seconds so the time for about 200 records will probably be a second or two.

However, it occurs to me that having loaded the subfile, I shouldn't need to read the data file again.  I am thinking there must be an easy way to save the subfile in case it is needed again, instead of just clearing it, or am I tilting at windmills?

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.