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



Cobol Newbie question...........

I am reading files created thru DDS in an RPG environment.

When the COPY command is executed during my ILE Cobol compile, I get the following:

*THE KEY DEFINITIONS FOR RECORD FORMAT TFOOD00
*   NUMBER       NAME               RETRIEVAL          ALTSEQ
*     0001             ODORG             ASCENDING           NO
*     0002             ODTOOR           ASCENDING           NO
*     0003             ODTOLN           ASCENDING           NO
           05   TFOOD00.
                   06  ODORG                               PIC X(3).
06 ODPLN PIC S9(9) COMP-3.
                   06  ODSWHS                            PIC X(3).
                   06  ODORTP                             PIC X(3).
                   06  ODTOLN                             PIC S9(7) COMP-3.
                   06  ODTOOR                             PIC S9(9) COMP-3.
                   06  ODSHOR                             PIC S9(9) COMP-3.
                     ..... etc ....
I have another file, TFOOH, that is the 'driver' file. Once I find a record in the TFOOH, I then want to access all the associated records in the TFOOD. I have OHORG and OHTOOR fields in the TFOOH which can be used to point to the correct set of records in the TFOOD.

My question is, how do I do a START on the TFOOD file, so that I am positioned to the 1st record I want.

If I had defined the file myself, I would have a key setup as:

                   06  TFOOD-KEY.
                         07  ODORG                               PIC X(3).
07 ODTOOR PIC S9(9) COMP-3. 07 ODTOLN PIC S9(7) COMP-3.

Then I could populate the 1st 2 fields and do a START NOT < TFOOD-KEY.
But since these are not group, how do I do it in ILE COBOL?
I do not want to START on the ORORG and READ until I finally get a hit.... there are 10000s of records.

Thanks for any help!!!

------------------------------------------------------------------------
Don Stafford, Director of Information Technologies
UAV Entertainment Corporation
2200 Carolina Place
Fort Mill, SC  29708
803-548-1056  x1159
803-548-2493 - Fax
don.stafford@xxxxxxxxx



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.