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

4-: 3
Columns 58-59 direct RPG to turn on the LR indicator when the
user enters an end-of-data signal (:EOD or :).
5 This line turns on the resulting indicator 80.
6 This line performs exception output (lines 7 and 8) when the
user enters a valid date.
7 This line begins the output record description for the file,
OUTPUT.
A Sample Program Using READ and EXCPT
Figure 4-3 lists a program that updates an TurboIMAGE data set using READ
and EXCPT. The data set that is updated is M-SOURCE (see the schema for
this data set in Figure 3-21). The program prompts a terminal user to
enter a source code (SRCCDO). It then reads the source code record in
M-SOURCE. If the record exists, the source description field is updated.
If the record does not exist, a new record is added for that source code.
The next section, "Running the Sample Program," shows what a typical
display looks like when the program is executed.
The program in Figure 4-6 is identical to that shown in Figure 4-3,
except that Figure 4-6 uses DSPLY instead of READ/EXCPT. Comparing these
programs should help you to understand the differences between READ/EXCPT
and DSPLY/DSPLM.