HP RPG/XL Programmer's Guide (30318-90001)

9- 9
Comments
1 This line defines the array, SRC, that contains the SOURCE-CODEs
from the M-SOURCE data set.
Column 45 is blank to indicate that the array elements are in
ascending sequence (D indicates descending).
2 This line defines the SOURCE-CODE field, SRCCD, in the M-SOURCE
data set.
3 This line fills the SRC array with SOURCE-CODEs from the
M-SOURCE data set.
4 This line sorts the entries in the SRC array when all of the
SOURCE-CODEs have been retrieved from the M-SOURCE data set.
5 This is the first line in the loop that accesses each (sorted)
SOURCE-CODE in the SRC array.
6 This line defines the exception output record written by the
loop starting on line 5. SOURCE-CODEs are written in ascending
sequence, one per output record.
Releasing Printer Files
When you want to print data from a printer file before a program
finishes, release the data using column 16 of the Output Specification
(enter R into column 16 of the last Output Specification line you want to
print).
Normally, when you use a printer file, information accumulates during
program execution and is actually printed when the program ends. There
are occasions, however, when you may want to print data immediately, but
continue with the program. For example, when customers deposit money at
a bank, they get deposit receipts immediately. The online program that
processes deposits must "release" the printer file in order to print
these receipts.
Figure 9-5 shows how to release a printer file. The last line to be
printed (line 3) contains an R in column 16.
Figure 9-5. Releasing a Printer File