MSG Command

The MSG command sends a message to the user identified either by line number or by account name. MSG can also be used to broadcast a short message to all users on the system, to all users logged on to a particular account, to all lines, or to a specified line. This command is useful for sending quick communications between two users, such as for warning all users of an impending system shutdown.

Format

MSG {account | !line# | [!] *} message [(options)]

Parameter(s)

{account}

Name of the account you want to send a message.

{!line#}

Line number of the recipient. It must be preceded by an exclamation point (!).

{!}

Allows the message to be sent to terminals attached to processes that are not logged on.

{*}

Broadcasts the message to all logged-on users. The user must have at least SYS2 privileges to use this option.

message

Text of the message. Press ENTER to transmit the message.

Description

When a message is sent, the recipient’s terminal beeps and displays the time, date, sender’s account name and process number, and the message. For example:

>

15:53:15  dd mmm yyyy  FROM SYSPROG (0):

PLEASE LOG OFF NOW

A user who is typing characters when a message arrives might lose up to 16 characters due to the interference of the message. The original prompt and all retained characters can be restored by pressing CTRL+R.

If you press ESC while entering the message, the characters that follow it are not transmitted.

By default, messages can be only two lines long. To enter messages longer than two lines or to insert a carriage return in a message, enter a value mark by typing CTRL+]. A value mark is displayed as a right bracket (]), and is interpreted as a carriage return.

The MSG command outputs directly to ports rather than to processes. This command supports the following options:

@(x,y)

Cursor addressing directive. The message outputs at column position x, on line y.

@(-n)

Screen functions (see the mvBASIC User Reference Guide - the @ function for valid Cursor Function Codes). If you are sending a message to a terminal that has a different type than your terminal, the system will set your terminal to the other terminal's type before sending the message. Once the message is sent, the system will restore your terminal back to its original type.

C(n)

Outputs ASCII character codes, where n is a valid decimal ASCII character.

(S)

Suppresses the time, date, and From Account, portions of the message, allowing the user more control over the format of the output display.

(L)

Used with the ! option. Outputs to all processes that are linked to ports, even if they are logged off. Does not output to the spooler process.

#errmsg.id param1 param2...

Outputs the formatted message errmsg.id to the designated port(s), using parameters: param1, param2...

For Example:

MSG * #12 3 (S)

This sends the formatted message: "[12] 3 Power failures have occurred since Cold-start." to all users logged on.

 

NOTE

MSG!* carries the potential for negatively impacting the system and is undesirable. Because output is sent to every line, it is possible to send meaningless output into converse lines, modems, and other devices where it is not desirable.

Sending a Message to a User

The following example sends a message to the user on process 6:

>MSG !6  PLEASE LOG OFF (L

The next example sends a three-line message to the user whose account name is STEVE:

>MSG STEVE MEETING]AT 2]TOMORROW.

When it arrives on Steve’s screen, the message looks like this:

>

15:56:26  dd mmm yyyy  FROM DALE (0):

MEETING

AT 2

TOMORROW.

Broadcasting a Message to All Users

The following example broadcasts a message to all logged-on users:

>MSG * SYSTEM SHUTDOWN IN 5 MINUTES

The next example broadcasts a message to all terminals attached to processes, whether they are logged on or not:

>MSG !* TOMORROW THE SYSTEM WILL BE DOWN AFTER 5 PM. (L

 

NOTE

The MSG command will not output to processes ATTACHed to other ports. This protects a particular port from receiving messages when an important job is running, for example, printing checks on a slave printer.