$SirWarn: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Send warning or message to user(s)<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Send warning or message to user(s)<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SirWarn function is [[to be entered]].</p>
<p class="warning">Most Sirius $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 methods|Daemon]].</p>


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.  
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.  
Line 11: Line 11:


The second argument is the text of the warning to be sent to the user(s) indicated by the first argument.
The second argument is the text of the warning to be sent to the user(s) indicated by the first argument.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $SirWarn (user, message)
<p class="syntax"><section begin="syntax" /> %RC = $SirWarn (user, message)
Line 17: Line 18:
</p>
</p>
<p class="caption">%RC is set to indicate the success of the function.</p>
<p class="caption">%RC is set to indicate the success of the function.</p>
<p class="code">  
<p class="code">  
  0 - Warning issued
  0 - Warning issued
Line 26: Line 28:
</p>
</p>


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


The following statement sends a warning of an application error to the operator:
<p class="code"> %RC = $SirWarn('OPR', -
<p class="code"> %RC = $SirWarn('OPR', -
  'Severe application error for user' WITH $USER)
  'Severe application error for user' WITH $USER)
</p>
</p>
This statement sends a warning to user 57 to leave subsystem BARNEY:
This statement sends a warning to user 57 to leave subsystem BARNEY:
<p class="code"> %RC = $SirWarn(57, 'Please leave subsystem BARNEY')
<p class="code"> %RC = $SirWarn(57, 'Please leave subsystem BARNEY')
</p>
</p>
This statement sends a warning to all users logged on as HOMER to call Marge:
This statement sends a warning to all users logged on as HOMER to call Marge:
<p class="code"> %RC = $SirWarn('HOMER', 'Please call Marge')
<p class="code"> %RC = $SirWarn('HOMER', 'Please call Marge')
</p>
</p>
<p class="code">
<ul>
<li>&SFUNC


<ul class="smallAndTightList">
<li>[[Sirius $Functions]]
</ul>
</ul>
</p>
<p class="caption">Products authorizing $SirWarn
<p class="caption">Products authorizing $SirWarn
</p>
</p>

Revision as of 18:56, 8 February 2011

<section begin="desc" />Send warning or message to user(s)<section end="desc" />

Most Sirius $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.

$SirWarn accepts two arguments and returns a number.

The first argument 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 the first argument 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.

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

Syntax

<section begin="syntax" /> %RC = $SirWarn (user, message) <section end="syntax" />

$SirWarn Function

%RC is set to indicate the success of the function.

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

$SirWarn return codes

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

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

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

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

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

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

Products authorizing $SirWarn