$SirWarn

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Send warning or message to user(s)

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $SirWarn function, because it is very easy to do the same thing using a Daemon.

The $SirWarn function is used to send a warning or message to the specified user or users. If the user invoking $SirWarn is a system manager or system administrator, $SirWarn acts like a WARN command; otherwise it acts like an MSG command.

Syntax

%rc = $SirWarn (user, message)

Syntax terms

%rc A numeric variable that is set to indicate the success of the function.
user Identifies the user(s) to receive the warning.

If this argument is the string OPR, the warning is sent to the operator's console (or virtual console under CMS). If this argument is a valid user number, the warning is sent to the indicated user number. If it is neither OPR nor a valid user number, it is treated as a userid, and the warning is sent to every user logged on to this userid.

message The text of the warning to be sent to the user(s) indicated by the user argument.

Return codes

0 - Warning issued 1 - User(s) not logged on 2 - Insufficient storage 3 - Parameter missing (either userid or message)

Examples

  1. The following statement sends a warning of an application error to the operator:

    %rc = $SirWarn('OPR', 'Severe application error for user' WITH $USER)

  2. This statement sends a warning to user 57 to leave subsystem BARNEY:

    %rc = $SirWarn(57, 'Please leave subsystem BARNEY')

  3. This statement sends a warning to all users logged on as HOMER to call Marge:

    %rc = $SirWarn('HOMER', 'Please call Marge')

Products authorizing $SirWarn