Print Output with QSYSPRT

QSYSPRT is a printer file provided by IBM. It can be used to make some simple print outputs.

First define the printer file in the program:

  dcl-f qsysprt printer(132) usage(*output) oflind(overflow);

Notice the overflow indicator specified with the parameter OFLIND. The indicator variable must not be defined otherwise or else you get RNF2037 on compile.

The line length is specified as a parameter of the printer keyword, in our case 132 characters.

You need a variable to place your content which should be printed.

  dcl-ds line len(132) end-ds;

Now you can fill the line and print the content like this:

  line = 'Line ' + %char(i);
  write qsysprt line;