External message queue

The external message queue (*EXT) is used to communicate with the external requester (such as a display station user) of the job.

Messages sent to *EXT are displayed in the following ways:

  • Display Program Messages screen

    If an informational, inquiry, or notify message is sent to the external message queue for an interactive job, the message is displayed on the Display Program Messages display. Additionally, the program or procedure waits for a reply to inquiry or notify messages from the display station user. If the user does not enter a reply and press the Enter key or F3 (Exit), the default message reply is returned to the sender of the message. If there is no default message reply, *N is sent. If you send an inquiry or notify message to the external message queue for a batch job, the system sends the default reply back to you. If there is no default message reply, *N is the reply. The system reply list may override the displaying of inquiries or the sending of default replies to inquiries to *EXT.

  • Message line of the display station
    If a status message is sent to the external message queue of an interactive job, the message is displayed on the message line of the display station. You can use status messages like this to inform the display station user of the progress of a long-running operation. For example, the system sends status messages when running the CPYF command if you copy a file with several members.
    Note: When your application completes the long-running operation, you must send another message to clear the message line at the display. You can use message CPI9801, which is a blank message, for this purpose. For example:
    
    PGM
    .
    .
    .
    SNDPGMMSG  MSGID(CPF9898)  MSGF(QCPFMSG)  MSGDTA('Status 1')  +
               TOPGMQ(*EXT)  MSGTYPE(*STATUS)
    .
    .
    .
    SNDPGMMSG  MSGID(CPF9898)  MSGF(QCPFMSG)  MSGDTA('Status 2')  +
               TOPGMQ(*EXT)  MSGTYPE(*STATUS)
    .
    .
    .
    SNDPGMMSG  MSGID(CPI9801)  MSGF(QCPFMSG)  TOPGMQ(*EXT)  +
               MSGTYPE(*STATUS)
    .
    .
    .
    ENDPGM
    

Messages (except status messages) sent to the external message queue of a job are also placed on the job log.