15 pts.
 two PF have same field
there are two PF, each Pf have same named field, but the length of the field not same. how can i use the field in the program?

Software/Hardware used:
ASKED: April 30, 2008  1:51 AM
UPDATED: April 19, 2010  7:03 AM

Answer Wiki:
One option would be to use the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books_web/c0925086314.htm#HDRFPREFIX">Prefix</a> keyword to alter the names of the fields found in one of the files. Long term I would recommend finding a way to eliminate the use of the same name for what would appear to be two different fields. Bruce Vining
Last Wiki Answer Submitted:  April 30, 2008  9:55 am  by  bvining   6,055 pts.
All Answer Wiki Contributors:  bvining   6,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If it’s just one field I’d reference the external file in my I specs with a field override name. But Bruce has the long term solution. If you are using DDS for the definition you really should consider using a REFFILE to contain all your field names. That will keep you from having duplicate field names.

 45 pts.

 

If it’s just one field I’d reference the external file in my I specs with a field override name.

Since the fields have different lengths, the file format level IDs will be different. A level check will result. If disabling level checks is suggested, then which format should provide the compile specs? What will happen when a record buffer has the other record format in it? (Data will probably be corrupt.)

The problem needs more explanation.

Why is having to fields with the same name a problem when they have different lengths? Most likely the two files are to be accessed concurrently. RPG will want to store the fields in the same memory location under the single name.

Perhaps the two records can be loaded into separate DS’s and qualified references will the fields different.

Tom

 107,735 pts.