$CfStatL: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(13 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">List of statistics for users holding critical file resources</span>
<span class="pageSubtitle">List of statistics for users holding critical file resources</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $CfStatL function.</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $CfStatL function.</p>


This function allows retrieval of statistics for all users holding critical file resources in a given file into a $list.  
This function allows retrieval of statistics for all users holding critical file resources in a given file into a $list.  


The <var>$CfStatL</var> function accepts three arguments and returns a numeric error code.


The first argument is the indentifier of the $list that is 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:
==Syntax==
<table class="syntaxTable">
<p class="syntax"><span class="term">%result</span> = <span class="literal">$CfStatL</span>(<span class="term">list_identifier</span>, <span class="term">stat_list</span>, <span class="term">file_num</span>)
</p>
 
===Syntax terms===
<table>
<tr><th>%result</th>
<td>Either a positive number which is the number of milliseconds since the Online was brought up, or a negative [[#Return codes|error]] code.</td></tr>
 
<tr><th>list_identifier</th>
<td>The indentifier of the $list that is 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="thJustBold">
<tr><th>Byte 1-10</th>
<tr><th>Byte 1-10</th>
<td>Blank padded userid</td></tr>
<td>Blank padded userid</td></tr>
Line 17: Line 26:
<td>Returned statistics
<td>Returned statistics
</td></tr></table>
</td></tr></table>
</td></tr>


The second argument is a string of blank-delimited words indicating the statistics to be returned. All standard user statistics can be returned, as well as extra critical file resource held statistics. 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 on available statistics see the <var class="product">[http://sirius-software.com/maint/download/monr.pdf SirMon User's Guide]</var>.
<tr><th>stat_list</th>
<td>A string of blank-delimited words indicating the statistics to be returned. All standard user statistics can be returned, as well as extra critical file resource held statistics. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of <var>[[$StatLD]]</var> with the returned $list.  
<p>
For more information on available statistics, see [[Critical File Resource statistics displayed in SirMon]].</p> </td></tr>


The third argument is the file number of the file in which the returned list of users hold critical file resources. Unlike selection criterion for $USSTATL, users not holding critical file resources in the indicated file are not placed on the output $list. This could prevent them from being placed on the difference $list by a $StatLD call if rates or differences are calculated.
<tr><th>file_num</th>
<td>The file number of the file in which the returned list of users hold critical file resources. Unlike selection criterion for <var>[[$UsStatL]]</var>, users not holding critical file resources in the indicated file are not placed on the output $list. This could prevent them from being placed on the difference $list by a <var>$StatLD</var> call if rates or differences are calculated.</td></tr>
</table>


==Syntax==
===Return codes===
<p class="syntax"><section begin="syntax" />%result = $CfStatL(list_identifier, stat_list, file_num)
<p class="code"> -3 - CCATEMP is full
<section end="syntax" /></p>
-5 - Required parameter not specified
 
-6 - Invalid $list identifier
<p>%result is a either a positive number which is the number of milliseconds since the online was brought up, or is a negative error code.</p>
-12 - Invalid name in stat_list
<p class="code">  
-13 - STAT not linked in
  -3 - CCATEMP is full
-16 - Invalid file number
  -5 - Required parameter not specified
  -6 - Invalid $list identifier
-12 - Invalid name in stat_list
-13 - STAT not linked in
-16 - Invalid file number
</p>
<p class="caption">$CfStatL return codes
</p>
</p>


==Example==
The following program displays users and resources for users holding critical file resources in file number 13.
The following program displays users and resources for users holding critical file resources in file number 13.
<p class="code"> B
<p class="code">B
  %DATA IS STRING LEN 255
%DATA IS STRING LEN 255
  %LIST = $ListNew
%LIST = $ListNew
  %DATA = $CfStatL(%LIST, 'HDDIRCT HDINDEX HDEXIST HDRECNQ', 13)
%DATA = $CfStatL(%LIST, 'HDDIRCT HDINDEX HDEXIST HDRECNQ', 13)
  IF %DATA < 0 THEN
IF %DATA < 0 THEN
    PRINT '$CFSTATL ERROR... RC = ' WITH %DATA
    PRINT '$CFSTATL ERROR... RC = ' WITH %DATA
    STOP
    STOP
  END IF
END IF
   
   
  FOR %I FROM 1 TO $ListCnt(%LIST)
FOR %I FROM 1 TO $ListCnt(%LIST)
    %DATA = $ListInf(%LIST, %I)
  %DATA = $ListInf(%LIST, %I)
    PRINT 'USERID = ' WITH $SUBSTR(%DATA, 1, 10)
  PRINT 'USERID = ' WITH $SUBSTR(%DATA, 1, 10)
    PRINT 'USERNUM = ' WITH -
  PRINT 'USERNUM = ' WITH -
    $UNBIN( $SUBSTR(%DATA, 11, 2) )
  $UNBIN( $SUBSTR(%DATA, 11, 2) )
    PRINT 'HDDIRCT = ' WITH $SUBSTR(%DATA, 13, 4)
  PRINT 'HDDIRCT = ' WITH $SUBSTR(%DATA, 13, 4)
    PRINT 'HDINDEX = ' WITH $SUBSTR(%DATA, 17, 4)
  PRINT 'HDINDEX = ' WITH $SUBSTR(%DATA, 17, 4)
    PRINT 'HDEXIST = ' WITH $SUBSTR(%DATA, 21, 4)
  PRINT 'HDEXIST = ' WITH $SUBSTR(%DATA, 21, 4)
    PRINT 'HDRECNQ = ' WITH $SUBSTR(%DATA, 25, 4)
  PRINT 'HDRECNQ = ' WITH $SUBSTR(%DATA, 25, 4)
    PRINT
  PRINT
  END FOR
END FOR
   
   
  END
END
</p>
</p>
==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<li>[[SirMon|SirMon]]</li>
</ul>
<p>
</p>


[[Category:$Functions|$CfStatL]]
[[Category:$Functions|$CfStatL]]

Latest revision as of 14:02, 8 November 2018

List of statistics for users holding critical file resources

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $CfStatL function.

This function allows retrieval of statistics for all users holding critical file resources in a given file into a $list.


Syntax

%result = $CfStatL(list_identifier, stat_list, file_num)

Syntax terms

%result Either a positive number which is the number of milliseconds since the Online was brought up, or a negative error code.
list_identifier The indentifier of the $list that is 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
stat_list A string of blank-delimited words indicating the statistics to be returned. All standard user statistics can be returned, as well as extra critical file resource held statistics. 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 on available statistics, see Critical File Resource statistics displayed in SirMon.

file_num The file number of the file in which the returned list of users hold critical file resources. Unlike selection criterion for $UsStatL, users not holding critical file resources in the indicated file are not placed on the output $list. This could prevent them from being placed on the difference $list by a $StatLD call if rates or differences are calculated.

Return codes

-3 - CCATEMP is full -5 - Required parameter not specified -6 - Invalid $list identifier -12 - Invalid name in stat_list -13 - STAT not linked in -16 - Invalid file number

Example

The following program displays users and resources for users holding critical file resources in file number 13.

B %DATA IS STRING LEN 255 %LIST = $ListNew %DATA = $CfStatL(%LIST, 'HDDIRCT HDINDEX HDEXIST HDRECNQ', 13) IF %DATA < 0 THEN PRINT '$CFSTATL ERROR... RC = ' WITH %DATA STOP END IF FOR %I FROM 1 TO $ListCnt(%LIST) %DATA = $ListInf(%LIST, %I) PRINT 'USERID = ' WITH $SUBSTR(%DATA, 1, 10) PRINT 'USERNUM = ' WITH - $UNBIN( $SUBSTR(%DATA, 11, 2) ) PRINT 'HDDIRCT = ' WITH $SUBSTR(%DATA, 13, 4) PRINT 'HDINDEX = ' WITH $SUBSTR(%DATA, 17, 4) PRINT 'HDEXIST = ' WITH $SUBSTR(%DATA, 21, 4) PRINT 'HDRECNQ = ' WITH $SUBSTR(%DATA, 25, 4) PRINT END FOR END

Products authorizing $CfStatL