$FiStatL: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Retrieve set of files' statistics into list<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Retrieve set of files' statistics 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 $FiStatL function.</p> | ||
This function allows retrieval of statistics for a set of files into a $list. | This function allows retrieval of statistics for a set of files into a $list. | ||
Line 38: | Line 38: | ||
<p class="caption">%RESULT is either a positive number which is the milliseconds since the online was brought up, or it is a negative error code.</p> | <p class="caption">%RESULT is either a positive number which is the milliseconds since the online was brought up, or it is a negative error code.</p> | ||
<p class="code"> | <p class="code"> | ||
-3 - CCATEMP is full | |||
-5 - Required parameter not specified | |||
-6 - Invalid $list identifier | |||
-12 - Invalid name in stat_list | -12 - Invalid name in stat_list | ||
-13 - STAT not linked in | -13 - STAT not linked in | ||
Line 47: | Line 47: | ||
<p class="caption">$FiStatL return codes | <p class="caption">$FiStatL return codes | ||
</p> | </p> | ||
The following program displays some statistics for all files. | The following program displays some statistics for all files. | ||
Line 72: | Line 70: | ||
END | END | ||
</p> | </p> | ||
[[Category:$Functions|$FiStatL]] | [[Category:$Functions|$FiStatL]] |
Revision as of 21:25, 31 January 2011
<section begin="desc" />Retrieve set of files' statistics into list<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $FiStatL function.
This function allows retrieval of statistics for a set of files into a $list.
The $FiStatL function accepts three arguments and returns a numeric error code.
The first argument is the identifier 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 file name |
---|---|
Byte 11-12 | Binary file 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 $StatLD with the returned $list. For more information on available statistics, see the "SirMon User's Guide".
The third argument is a selection criterion that indicates which files, of all those that are currently open (by some user or by some subsystem), are to be included in the output $list. The following criteria are allowed:
FILE=fid | include only files with filenames matching fid (wildcards allowed). |
---|---|
SUBSYS=subsysid | include only files opened by subsystem subsysid. Wildcards are allowed. |
USER=usernum | include only files opened by user usernum. |
Actually, all files are always included in the output $list, but the excluded files have the high order bit of their file numbers turned on. This tells $StatLD to exclude the files from the difference $list.
Syntax
<section begin="syntax" /> %RESULT = $FiStatL(list_identifier, stat_list, criterion) <section end="syntax" />
-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 selection criterion
The following program displays some statistics for all files.
B %DATA IS STRING LEN 255 %LIST = $ListNew %DATA = $FiStatL(%LIST, 'DKIO CFRCONF CFRQUEU') IF %DATA < 0 THEN PRINT '$FISTATL ERROR... RC = ' WITH %DATA STOP END IF FOR %I FROM 1 TO $ListCnt(%LIST) %DATA = $ListInf(%LIST, %I) PRINT 'FILENAME = ' WITH $SUBSTR(%DATA, 1, 10) PRINT 'DKIO = ' WITH $UNBIN( $SUBSTR(%DATA, 13, 4) ) PRINT 'CFRCONF = ' WITH $UNBIN( $SUBSTR(%DATA, 17, 4) ) PRINT 'CFRQUEU = ' WITH $UNBIN( $SUBSTR(%DATA, 21, 4) ) PRINT END FOR END