$UsStatL: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Retrieve statistics for set of users into $list<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Retrieve statistics for set of users into $list<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $UsStatL function.</p> | ||
This function allows retrieval of statistics for a set of users into a $list. | This function allows retrieval of statistics for a set of users into a $list. | ||
Line 9: | Line 9: | ||
The first argument is the identifier of the $list to receive the results. The current contents of the $list are deleted and replaced with the requested statistics. The format of each $list item is: | The first argument is the identifier of the $list to receive the results. The current contents of the $list are deleted and replaced with the requested statistics. The format of each $list item is: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>Byte 1-10</th> | <tr><th>Byte 1-10</th> | ||
Line 16: | Line 17: | ||
<tr><th>Byte 13-</th> | <tr><th>Byte 13-</th> | ||
<td>Returned statistics | <td>Returned statistics | ||
</td></tr></table> | </td></tr> | ||
</table> | |||
The second argument is a string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of $StatLD with the returned $list. For more information about available statistics, see the ''"SirMon User's Guide"''. | The second argument is a string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of $StatLD with the returned $list. For more information about available statistics, see the ''"SirMon User's Guide"''. | ||
The third argument is a selection criterion that indicates which users are to be included in the output $list. The following criteria are allowed: | The third argument is a selection criterion that indicates which users are to be included in the output $list. The following criteria are allowed: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>ACCOUNT=acctid</th> | <tr><th>ACCOUNT=acctid</th> | ||
Line 44: | Line 46: | ||
<td>include only users with current activity matching '''activity''' (wildcards allowed). | <td>include only users with current activity matching '''activity''' (wildcards allowed). | ||
</td></tr></table> | </td></tr></table> | ||
In actual fact, all users are always included in the output list, but the excluded users have the high order bit of their user numbers turned on. This tells $StatLD to exclude the users from the difference $list. | |||
In actual fact, all users are always included in the output list, but the excluded users have the high order bit of their user numbers turned on. This tells [[$StatLD]] to exclude the users from the difference $list. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> %RESULT = $UsStatL(list_identifier, stat_list, criterion) | <p class="syntax"><section begin="syntax" /> %RESULT = $UsStatL(list_identifier, stat_list, criterion) | ||
Line 51: | Line 55: | ||
</p> | </p> | ||
<p class="caption">%RESULT is a either a positive number, which is the milliseconds since the online was brought up, or a negative error code.</p> | <p class="caption">%RESULT is a either a positive number, which is the milliseconds since the online was brought up, or a negative error code.</p> | ||
<p class="code"> | <p class="code"> | ||
-3 - No room to create $list items | |||
(if LISTFC $SirParm parameter not set) | |||
-5 - Required parameter not specified | |||
-6 - Invalid $list identifier | |||
-13 - STAT not linked in | -13 - STAT not linked in | ||
-16 - Invalid selection criterion | -16 - Invalid selection criterion | ||
Line 61: | Line 66: | ||
<p class="caption">$UsStatL return codes | <p class="caption">$UsStatL return codes | ||
</p> | </p> | ||
The following program displays some statistics for all users in subsystem SIRMON. | The following program displays some statistics for all users in subsystem SIRMON. | ||
Line 77: | Line 81: | ||
For %i from 1 to $ListCnt(%list3) | For %i from 1 to $ListCnt(%list3) | ||
%data = $ListInf(%list3, %i) | |||
Text | |||
userid = { $substr(%data,1,10) } - | |||
usernum = { $unbin($substr(%data,11,2)) } - | |||
iodev = { $unbin($substr(%data,13,4)) } - | |||
cpu total = { $unbin($substr(%data,17,4)) } | |||
End Text | |||
End For | End For | ||
End | End | ||
</p> | </p> | ||
<ul class="smallAndTightList"> | |||
<li>[[Sirius $Functions]] | |||
</ul> | </ul> | ||
<p class="caption">Products authorizing $UsStatL | <p class="caption">Products authorizing $UsStatL | ||
</p> | </p> | ||
[[Category:$Functions|$UsStatL]] | [[Category:$Functions|$UsStatL]] |
Revision as of 21:04, 8 February 2011
<section begin="desc" />Retrieve statistics for set of users into $list<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $UsStatL function.
This function allows retrieval of statistics for a set of users into a $list.
The $UsStatL function accepts three arguments and returns a numeric error code.
The first argument is the identifier of the $list to receive the results. The current contents of the $list are deleted and replaced with the requested statistics. The format of each $list item is:
Byte 1-10 | Blank padded userid |
---|---|
Byte 11-12 | Binary user number |
Byte 13- | Returned statistics |
The second argument is a string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of $StatLD with the returned $list. For more information about available statistics, see the "SirMon User's Guide".
The third argument is a selection criterion that indicates which users are to be included in the output $list. The following criteria are allowed:
ACCOUNT=acctid | include only users with account ids matching acctid (wildcards allowed). |
---|---|
CFR=fid | include only users holding or requesting critical file resources in files with filename matching fid (wildcards allowed). |
CHKP | include only users preventing checkpoints |
FILE=filename | include only users with filename open. |
IODEV=iodevnum | include only users on IODEV iodevnum. |
PNAME=pname | include only users running procedures with names matching termid (wildcards allowed). |
SUBSYS=subsysid | include only users in subsystem subsysid (wildcards allowed). |
TERMID=termid | include only users logged on terminals with ids matching termid (wildcards allowed). |
USER=userid | include only users with userids matching userid (wildcards allowed). |
WHAT=activity | include only users with current activity matching activity (wildcards allowed). |
In actual fact, all users are always included in the output list, but the excluded users have the high order bit of their user numbers turned on. This tells $StatLD to exclude the users from the difference $list.
Syntax
<section begin="syntax" /> %RESULT = $UsStatL(list_identifier, stat_list, criterion) <section end="syntax" />
-3 - No room to create $list items (if LISTFC $SirParm parameter not set) -5 - Required parameter not specified -6 - Invalid $list identifier -13 - STAT not linked in -16 - Invalid selection criterion
The following program displays some statistics for all users in subsystem SIRMON.
b %data is string len 255 %list1 = $ListNew %list2 = $ListNew %list3 = $ListNew %time1 = $UsStatL(%list1, 'IODEV CPU') Pause 1 %time2 = $UsStatL(%list2, 'IODEV CPU','SUBSYS=SIRMON') %rc = $StatLD(%list1, %list2, %list3, 'N N', %time2 - %time1) For %i from 1 to $ListCnt(%list3) %data = $ListInf(%list3, %i) Text userid = { $substr(%data,1,10) } - usernum = { $unbin($substr(%data,11,2)) } - iodev = { $unbin($substr(%data,13,4)) } - cpu total = { $unbin($substr(%data,17,4)) } End Text End For End