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



Thanks to ALL!!!
I did not understand that EXTERNALLY-DESCRIBED-KEY was the key I needed
MANY MANY Thanks!

----- Original Message ----- From: "R Bruce Hoffman" <bruce.hoffman@xxxxxxxxxxxxxxxxx>
To: "COBOL Programming on the iSeries/AS400" <cobol400-l@xxxxxxxxxxxx>
Sent: Monday, March 20, 2006 9:38 AM
Subject: Re: [COBOL400-L] Database File I-O


organization is indexed
access mode is dynamic
record-key is externally-described-key [with duplicates]


* --- Populate the key fields in the record.

start file key is not less than externally-described-key
 invalid key ...





On Mon, 2006-03-20 at 09:21 -0500, Don Stafford wrote:
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



--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.