RPG/400 Help

DSPLY (Display Function)

*---------*---------------*-----------------*----------------*---------------*
|   CODE  |    FACTOR 1   |     FACTOR 2    |     RESULT     |  INDICATORS   |
|         |               |                 |      FIELD     |               |
*---------*---------------*-----------------*----------------*---------------*
| DSPLY   | Message       | Output queue    | Response       |    _ ER _     |
|         | identifier    |                 |                |               |
*---------*---------------*-----------------*----------------*---------------*

The DSPLY operation allows the program to communicate with the display work station that requested the program. The operation can display a message and accept a response.

The value in factor 1 is used to create the message to be displayed. If factor 1 is specified, it can contain a field name, a literal, a named constant, a table name, or an array element whose value is used to create the message to be displayed. Factor 1 can also contain *M, followed by a message identifier that identifies the message to be retrieved from the message file, QUSERMSG. QUSERMSG must be in a library in the library list of the job receiving the message.

The message identifier can be from 1 to 7 characters in length and can include an optional alphabetic prefix of 3 characters followed immediately by 1 to 4 digits. If the alphabetic prefix is not specified, the default is USR. The numeric portion of the message identifier (1) must immediately follow either *M or the optional alphabetic prefix, (2) cannot include embedded blanks, and (3) must be left-adjusted (high-order zeros can be omitted). If the numeric portion of the message identifier is not specified, the default is 0000. Valid examples are:

Factor 1
Message Identifier
*M
USR0000
*MABC
ABC0000
*M1
USR0001
*MABC5
ABC0005

If specified, factor 2 can contain a character field, a literal, a named constant, a table name, or an array element whose value is the symbolic name of the object meant to receive the message and from which the optional response can be sent. Any queue name except a program message queue name can be the value contained in the factor 2 entry. The queue must be declared to the OS/400 system before it can be specified in factor 2. (For information on how to create a queue, see the Programming: Control Language Programmer's Guide.) There are two predefined queues:

Queue
Value
QSYSOPR
The message is sent to the system operator. Note that the QSYSOPR message queue severity level must be zero (00) to enable the DSPLY operation to immediately display a message to the system operator.
*EXT
The message is sent to the requester.

Note:
For a batch job, if factor 2 is blank, the default is QSYSOPR. For an interactive job, if factor 2 is blank, the default is *EXT.

The result field is optional. If it is specified, the response is placed in it. It can contain a field name, a table name, or an array element in which the response is placed. If no data is entered, the result field is unchanged.

Positions 56 and 57 can contain an indicator to be set on if an error occurs on the operation. If an error occurs when the workstation user enters the response, the message is displayed again a maximum of five times. After the fifth display, the indicator in positions 56 and 57, if specified, is set on. If this indicator is not specified, the exception/error handling routine receives control.

When you specify the DSPLY operation with no message identifier in factor 1, the operation functions as follows:

The format of the record written by the DSPLY operation with no message identifier in factor 1 follows:


(1)The maximum length of information that can be displayed is 52
characters.

                Variable Length(1)                Variable Length(1)
                *------------------*           *-----------------------*
                V                  V           V                       V
 
DSPLY
       ^    ^   ^                  ^  ^    ^   ^                       ^
       *----*   *------------------*  *----*   *-----------------------*
 
       blank        Contents of       blank      Contents of the result
                    factor 1 if                  field if both factor 1
                    it is                        and the result field
                    specified                    are specified.
                        or
                    contents of
                    the result field
                    if factor 1 is
                    not specified.
 
 
 

When you specify the DSPLY operation with a message identifier in factor 1, the operation functions as follows: the message identified by the factor 1 entry is retrieved from QUSERMSG, the message is displayed, and the program waits for the user to respond by entering data if the result field is specified. The response is placed in the result field. For information on how to format the display, see the Data Management Guide.

When replying to a message, remember the following:


[ Top of Page | Previous Page | Next Page | Table of Contents ]