Logo 
Search:

Cobol Forum

Ask Question   UnAnswered
Home » Forum » Cobol       RSS Feeds

Multiple record formats with same field names

  Asked By: Steve    Date: Oct 09    Category: Cobol    Views: 653
  

I have a very extensive cobol program that I wish to alter to use a logical file with multiple records formats.

This will help me in a special project required. Here is the logical over two files I have created:

A R ERR170R PFILE(ERR170P)
A K COMP17
A K PLNT17
A K PART17
A K ALTR17
A K OPNS17
A K MNTS17
A R ERR170EXTR PFILE(ERR170EXT)
A K COMP17
A K PLNT17
A K PART17
A K ALTR17
A K OPNS17
A K MNTS17


These files contain the same field names with the exception of one additional field in the EXT file.
What thi logical allows me is a merged version of these two file. This should allow me to simply
change the assignment statement to use an organized and sorted version.
In the FD I use COPY DD-ALL-FORMATS to pull both record formats in. The compiler likes
this part but it produces errors on uses of the fields defined in both formats with the same name
(all of them):

* 5840 MSGID: LNC1463 SEVERITY: 30 SEQNBR: 711000
Message . . . . : 'ER170-WRKCTR' is not unique in this context. Use
cannot be determined.

I am hoping there is a way that I can use a multiple record formats in a cobol program. I have asked here to others and
I have searched our archives. I find no instance where this has been used.

Other programming languages on the AS400 seem OK with it. Maybe if I define my DDS logical differently?

Can you help?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Multiple record formats with same field names Or get search suggestion and latest updates.




Tagged: