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

4-: 9
Factor 1 contains either a variable or constant. For DSPLM, Factor 1
contains a message identification. DSPLM displays messages from a User
Message Catalog (see the section titled "Using Message Files" for more
information on how to display messages from a User Message Catalog file).
Figure 4-5 shows how to use DSPLY. A date in the format, YYMMDD, is read
from the terminal. This date is converted to MMDDYY format and
displayed.
Figure 4-5. Using DSPLY to Read and Display Terminal Data
Comments
1 This line defines the output file, OUTPUT.
Columns 40-46 contain the device class name, $STDLST.
2 This line displays the prompt, YYMMDD. It then reads 6
characters from the terminal and saves them in the field,
YYMMDD.
3 The line converts the date into a MMDDYY format. For example,
when 890318
is multiplied by 100.0001, the result is 89031889.0318. When
saved in the result field, this number becomes 031889.
4 This line displays the converted date field, MMDDYY, on the
terminal.
A Sample Program Using DSPLY
Figure 4-6 lists a program that updates an TurboIMAGE data set using
DSPLY. The data set that is updated is M-SOURCE (see the schema for this
data set in Figure 3-21). The program gets a source code (SRCCDO) from
the terminal user, then reads the corresponding record in M-SOURCE. If
the record exists, the source description field is updated. If the