Problem solve Get help with specific problems with your technologies, process and projects.

Character limit causes problems

I have declared a program described printer file in RPG/400 with a length of 190. While printing I am able to see the length of 132 characters only in the spool file. Is the length limited? If not, how can I print the entire length of data?
I assume you are using the QSYSPRT file, which by default is 132 characters wide. If you have defined the file in your program by another name, it will still be using QSYSPRT as a device description, and there will be an override somewhere to make the program run properly.

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):


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.


Check out our section of application development topics

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

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.