Either way, you must perform an override command before you open the printer file in your program. You can do this either by running the OVRPRTF command before you call the program, or you can use QCMDEXC to execute the command from inside your program BEFORE you explicitly open the printer file.
The OVRPRTF command will look like this:
OVRPRTF QSYSPRT *FILE PAGESIZE(066 190) CPI(15) or if the file has another name in your program (e.g. MYFILE):
OVRPRTF MYFILE QSYSPRT PAGESIZE(066 190) CPI(15)
You can also add the parameters USRDTA('Some text') and/or SPLFNAME(NEW_NAME) -- these will make it easy to recognize the spooled file when it has been created by your program.
MORE INFORMATION ON THIS TOPIC
Visit the ITKnowledge Exchange and get answers to your developing questions fast.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.
Dig Deeper on RPG iSeries programming
Related Q&A from John Blenkinsop
When an error occurs on an IBM command, the diagnostic messages are sent first, then an escape message, which you can monitor. On AS/400 you see the ... Continue Reading
Learn how to 'append data to the file' with the FTP DIR command, and eliminate the hassle of having to end the FTP session and restart to view ... Continue Reading
RPGIV will 'think of' incoming integer fields as binary, and then will redefine them in the program structures as PACKED. So, when you chain a record... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.