Thank you for all the tips.  I am setting my sights on the %Alloc method for
other projects, but as Scott said, for this few elements, memory shouldn't
be a concern.  

I came up with an interesting solution, and wanted to share it and see if
anybody else has used this method.  

I made two arrays, one a character array, the other a data structure array:

     D SiteCursor      S              3A   Inz(*Blanks)
     D                                     Dim(200)
     D                                     Ascend

     D SiteSum         DS                  Dim(300)
     D                                     Qualified
     D  SiteChgs$                    11P 2 Inz(0)
     D  SiteNPmt$                    11P 2 Inz(0)

I step through the company file, populate the SiteCursor array, store the
total element count, and SORTA the SiteCursor array.  I then walk through
the TRANS table LF (~13mil recs, keyed descending by date), and for each
record, using the TRANS company field, I do a %lookup on the SiteCursor
array, and use that element number to add the totals to the SiteSum array.
This creates virtual 'synchronization' between the two arrays.  As soon as I
reach a record that is before the beginning of the current month, I LEAVE
the loop.  

Next, I am charged with generating some sort of HTML chart from the data in
the array.  I haven't completed that part yet, but the above processing runs
in UNDER 12 SECONDS!!!  I know that is due mostly to the descending key
order and the use of the conditional LEAVE op, but to the rest of the world,
I am churning through millions of records in seconds!  

BOO YAA!!!

Tony Carolla
MedAmerica Billing Services, Inc. 

This thread ...


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

This mailing list archive is Copyright 1997-2026 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.