ibm-midrangedb2-400rpglerpg

AS400 duplicate fileds name different types in logical file


I'm Facing with issue in my programs. There is 2 physical files which declares field as xxBABA. 'xx' is different for two of this PF's and the these fields have different types one char other decimal. There exist logic file which contains this two files.

In program 'xx' prefix is replaced by YY for all fields so there is YYBABA char and YYBABA decimal.

Is there any way to get data from the second one?


Solution

  • If the program is in RPG, you can rename one or both of the fields using an I spec.

         IPF1RECFMT    
         I              XXBABA                      XXBABA#                               
         IPF2RECFMT    
         I              XXBABA                      XXBABA@