2 Printer Files in ILE Program

pcatetx

Member
I have an ILE program that uses 2 Printer files. One Printer file has Heading1 and Detail1 and the other printer file has Heading2 and detail2. When I compile printer file 1 it compiles with Record format Heading1, Detail1, $HEADNG1, $HEADNG2, and others; when I compile printer file 2 it compiles with Record format Heading2, Detail2, and those other weird record formats. This is not a problem until I try to compile the program and I get "Record format previously defined" error. Is there a way to compile the 2nd record format with only Record Format Heading2 and detail2?
 
It sounds like you have the same record format defined in both print files. Maybe you should upload the PRTF files so that someone could take a look...

Terry
 
[ QUOTE ]

pcatetx wrote:
I have an ILE program that uses 2 Printer files.

One Printer file has Heading1 and Detail1 and the other printer file has Heading2 and detail2.

When I compile printer file 1 it compiles with Record format Heading1, Detail1, $HEADNG1, $HEADNG2, and others; when I compile printer file 2 it compiles with Record format Heading2, Detail2, and those other weird record formats.

This is not a problem until I try to compile the program and I get "Record format previously defined" error. Is there a way to compile the 2nd record format with only Record Format Heading2 and detail2?

[/ QUOTE ]


RPGIV (ILE) is not as forgiving as RPG/400 (OPM) with JDE printer files.

If the 2nd printer file was compiled via SVR, it also contains the JDE-defined record formats (the ones whose names begin with $ and @) that are used for printing the cover page and instructions.

In order for your program to compile successfully, you'll need to IGNORE those formats on the 2nd printer file.

Code the following statements for the 2nd printer file - put them right after the F-spec for the 2nd printer file (Since JDELIST strips out the blanks, IGNORE goes in the Keyword area of the F-spec - see the attachment to this posting for the actual specs to use):

F IGNORE($HEADNG1)
F IGNORE($HEADNG2)
F IGNORE($HEADNG3)
F IGNORE($HEADNG4)
F IGNORE($DETAIL1)
F IGNORE($DETAIL2)
F IGNORE($DETAIL3)
F IGNORE($DETAIL4)
F IGNORE($DETAIL5)
F IGNORE($DETAIL6)
F IGNORE(@HEADNG1)
F IGNORE(@DETAIL1)
F IGNORE(@DETAIL2)
F IGNORE(@DETAIL3)
F IGNORE(@DETAIL4)
F IGNORE(@DETAIL5)

By the way, a more efficient way is to put these statements into a source member and use /COPY to copy it into the program right after the F-spec for the 2nd printer file.

Regards,
 
Back
Top