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

4-: 17
Reading a Message File. This section explains how to use the Calculation
Specification operation, DSPLM, to read and display messages contained in
a User Message Catalog file (see the previous section for information on
how to create a User Message Catalog file).
Although this section does not show how to use the Calculation
Specification operation, MSG, you can use it also to access messages in a
User Message Catalog file. Instead of displaying a message, MSG saves it
in a field specified by the program. MSG is useful when you need to
tailor a message before displaying it.
Figure 4-11 shows how the messages shown in Figure 4-10 are accessed and
displayed using DSPLM. You enter a message identification number with
DSPLM that identifies a message in the User Message Catalog file. RPG
retrieves that message and displays it. RPG assumes that the User
Message Catalog name is CATALOG. If the file has another name, enter a
system FILE command before running the program that equates the name to
CATALOG. For instance, to equate the name, CAT4, enter this file
equation,
FILE CATALOG=CAT4
Figure 4-11. Using a User Message Catalog File
Comments
1 This line displays message 1:1 from the User Message Catalog.
Columns 18-27 identify the message (1:1) in the User Message
Catalog file (see line 2 in Figure 4-10). The identification
number consists of two parts. The first part is the message
number (1) within the set and the second part is the set number
(1).
Columns 28-32 contain DSPLM to specify that the data to be
displayed on the terminal comes from a User Message Catalog
file.
2 This line displays message 2:1 from the User Message Catalog and
accepts a date entered by the user.
Columns 18-27 identify the message (2:1) in the User Message
Catalog file. (See line 1 for an explanation of the message
identification.)
Columns 28-32 contain DSPLM to specify that the data to be
displayed on the terminal comes from the User Message Catalog
file.