dspmsg - Display message from message catalog

Synopsis

dspmsg [-n] [-s set] catalog msgid [ defaultMsg [ arguments ... ] ]

Description

The dspmsg utility displays a message from a message catalog created by the GENCAT CL command. The message is written to standard output. The dspmsg utility can be used as a replacement for echo or print when a script needs to display messages that are translated to multiple languages.

Options

-n
Display the specified message with no substitution.
-s set
Retrieve the message from the specified set in the message catalog. The default value for set is 1.

Operands

The catalog operand specifies the path name to a message catalog. If the catalog is specified using a relative path name, the NLSPATH variable and the LC_MESSAGES locale catagory are used to find the catalog.

The msgid operand specifies the message identifier to retrieve from the message catalog.

When the specified catalog or msgid is not found, the optional defaultMsg is displayed instead. If the defaultMsg operand is not specified, a system generated message is displayed.

The optional arguments are substituted into the output message if it contains the %s, %n$s, %ld, or %n$ld printf() conversion specifications. Any other conversion specifications are not valid. Also, the normal control character escapes (for example, \n) are supported.

Exit Status

Related information

Examples
  1. Display message 5 from catalog mycat.
    dspmsg mycat 5 "Message not found" hello