AS400 COBOL regarding multiple logical files with external keys and same format.

pts.
Tags:
AS/400
COBOL
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

You must qualify the data item on each statement. For example:

Move data-name1 of F4111LD to …
Move data-name1 of F4111L1 to …

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Phruska
    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
    0 pointsBadges:
    report
  • Maclin
    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!
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following