AS/400 COBOL: Trying to read one logical path to process a certain set of transactions and under certain circumstances read another logical path over the same physical file to retrieve supplemental data. Getting stuck on compiler error "LBL1463'(data-item) previously defined in program, use cannot be determined. Default item assumed." Cannot ascertain what combination of redefines, renames, copy-dd or whatever to get around this. I need both files to be externally described for the format and the record keys, see code example below. Very simply handled in RPG but they make me write in COBOL here (for now anyway). Thanks for your time, best regards........
SELECT F4111LD ASSIGN TO DATABASE-F4111LD
ACCESS IS SEQUENTIAL
ORGANIZATION IS INDEXED
RECORD KEY IS EXTERNALLY-DESCRIBED-KEY
FILE STATUS IS F4111LD-STATUS.
SELECT F4111LI ASSIGN TO DATABASE-F4111LI
ACCESS IS DYNAMIC
ORGANIZATION IS INDEXED
RECORD KEY IS EXTERNALLY-DESCRIBED-KEY
FILE STATUS IS F4111LI-STATUS.
FD F4111LD
LABEL RECORDS ARE STANDARD.
01 F4111LD-RECORD-SRC.
COPY DDS-ALL-FORMATS OF F4111LD.
FD F4111LI
LABEL RECORDS ARE STANDARD.
01 F4111LI-RECORD-SRC.
COPY DDS-ALL-FORMATS OF F4111LI.
Both files have the same format name "I4111", and the same exact set of fields as they are logicals built over the one physical.
Software/Hardware used:
ASKED:
October 11, 2005 2:38 PM
UPDATED:
October 13, 2005 9:28 AM
Or you can define one file with the long field names and the other file with the short field names.
Move 1234 TO F4111-ITEM-NUMBER
MOVE 1234 TO ITEMNBR
Thanks for the replies everybody.
The suggestion from bgross was my solution. I did try to qualify the field names before submitting my question, but I was using the record name instead of the file name on the qualification and the compiler errors generated then were just adding to my confusion.
I needed to use the externally described keys and records from the dds and not program-described fields. Since I needed the keys to be externally described I could not use the replacing phrase on the COPY either.
Thanks again to bgross for the extra-quick reply, it saved my day!