The only time you need to CRTPRTF is if in your RPG program you use that file name and code it as ‘E” externally defined.
They you do WRITE to the formats that you coded in the DDS for the PRTF.
If you do not code your Printer as externally defined, then you use ‘O’ specs do produce your output.
The RPG compiler <b>does not</b> write the DDS into the RPG source. The compiler retrieves the attributes from the compiled printer file. If no printer file is compiled (with CRTPRTF), the RPG compiler can’t find the attributes. The RPG compiler has no idea where the DDS would be for a printer file.
This is the same for a disk file — the disk file must already be compiled. And display files must already be compiled. Printer files are no different.
That is what “externally described” files are all about. The descriptions are retrieved from compiled file objects.
A “program described” file has the description coded in the RPG source. The descriptions for those are not taken from the file objects.
The RPG compiler doesn’t create external file objects. File objects are created either by the DDS compiler or by a specific additional component such as SQL.