× 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.



Currently my program below reads every single record in the file to see if it 
matches certain criteria before processing a record.  There are millions
of records in this file and it takes the program forever to complete.  The 
criteria for checking each record depends on whatever the user enters.  So
far there's
about 5 or 6 criteria it must meet.  1 happens to be a date range, another is 
customer number, billing numbers, etc...  I don't want to create any
logicals since
the criteria can change, but I'd like to have the subprocedure read a file 
that's already sorted.

Would executing an OPNQRYF statement via QCMDEXC before executing the 
subprocedure be the best route?  SQL? other ideas?

     P FILE_PRCS        B
      *
      /FREE

           // Read FB File
           SETLL *LOVAL FILE_A;
           DOU %EOF(FILE_A);
           READ FILE_A;

                // End of File
                IF %EOF(FILE_A);
                LEAVE;
                ENDIF;

                // Validate Record
                IF BLAH BLAH = BLAH BLAH etc...;
                PROCESS_RECORD();
      ELSE;
      ITER;
      ENDIF;

            ENDDO;

      /END-FREE
      *
     P FILE_PRCS        E


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.