User Tools

Site Tools


print_output_with_qsysprt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

print_output_with_qsysprt [2018/06/06 12:09] (current)
mihael created
Line 1: Line 1:
 +====== 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;
 +
 +{{tag>​ibm devel rpg}}
print_output_with_qsysprt.txt ยท Last modified: 2018/06/06 12:09 by mihael