Commands used to send messages to a system user

Several commands can be used to send messages to system users.

  • Send Message (SNDMSG)
  • Send Break Message (SNDBRKMSG)
  • Send Program Message (SNDPGMMSG)
  • Send User Message (SNDUSRMSG)

Send Program Message (SNDPGMMSG) and Send User Message (SNDUSRMSG) can only be used in batch or interactive original program model (OPM) programs or Integrated Language Environment® (ILE) procedures. These commands cannot be entered on a command line. The Send Message (SNDMSG) command sends an informational or inquiry message to the system operator message queue (QSYSOPR), a display station message queue, or a user message queue. You can send an informational message to more than one message queue at a time. But you can send an inquiry message to only one message queue at a time. The message is delivered by the delivery type specified for the message queue. The message does not interrupt the user unless the message queue is in break mode.

The following Send Message (SNDMSG) command is sent by a display station user to the system operator:


SNDMSG   MSG('Mount tape on device TAP1') TOUSR(*SYSOPR)

The Send Break Message (SNDBRKMSG) command sends an immediate message from a workstation, a program, or a job to one or more display stations to be delivered in the break mode regardless of what delivery mode the receiver's message queue is set to. This command can be used to send a message only to display station message queues. You should use the Send Break Message (SNDBRKMSG) command when sending any message that requires the immediate attention of a display station user. You cannot ensure the message will cause a break, because each job has control by using the BRKMSG parameter on the Change Job (CHGJOB) command.

If you send an inquiry message, you can specify that the reply be sent to a message queue other than that of your display station.

The following Send Break Message (SNDBRKMSG) command is sent by the system operator to all the display station message queues:


SNDBRKMSG MSG('System going down in 15 minutes')
          TOMSGQ(*ALLWS)

The disadvantage of sending this message is that it is sent to all users, not just those users who are active at the time the message is sent.