$UsStatL
Retrieve statistics for set of users into $list
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $UsStatL function is the UserStatistics class.
Syntax
%result = $UsStatL(list_identifier, stat_list, [criterion])
Syntax terms
%result | Either a positive number, which is the milliseconds since the Online was brought up, or a negative error code. | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
list_identifier | 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:
| ||||||||||||||||||||
stat_list | 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 User statistics displayed in SirMon. | ||||||||||||||||||||
criterion | A selection criterion that indicates which users are to be included in the output $list. The following criteria are allowed:
|
Error codes
-1 — User is not waiting. (The wait type of a running user is -1.) -3 — No room to create $list items (if LISTFC $SirParm parameter not set). -5 — Required parameter not specified. -6 — Invalid $list identifier. -12 — invalid stat name. -13 — STAT not linked in. -16 — Invalid selection criterion.
Example
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