Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.ifsStat() UDTF returns a one row result that contains the attributes for the specified IFS file. The information returned in similar to that which is returned by the stat64() C runtime function.
UDF | Return Type | Description |
IFSSTAT | TABLE | Returns a resultSet that contains the properties (attributes) of the specified IFS file. |
table( iQuery.ifsStat( 'fully-qualified IFS file' ) )
The fully-qualified IFS file name is the name of the IFS file whose attributes are to be returned.
Column | Type | Description |
OBJTYPE | varchar(10) | Type of IBM i object (*STMF or *DIR) |
FILESIZE | BIGINT | Size of the file in bytes. |
ALLOCSIZE | BIGINT | Allocated space for the file. May be larger than FILESIZE |
CCSID | INT | The CCSID of the file. |
LINKS | BIGINT | Number of links to the file (aka "shortcuts") |
CRTTIME | timeStamp | The date/time when the file was created. |
ACCTIME | timeStamp | The date/time when the file was last accessed. |
CHGTIME | timeStamp | The date/time the file object's attributes where last changed. |
MODTIME | timeStamp | The date/time the data in the file was last modified. |
select * from table( iQuery.ifsStat( '/home/cozzi/country.txt') ) stats;
The output from the above UDTF would be similar to the following:
OBJTYPE FILESIZE ALLOCSIZE CCSID LINKS *STMF 3949 8192 1252 1
and...
CRTTIME ACCTIME CHGTIME MODTIME 2013-03-01 11.57.45.000000 2019-06-10 22.00.24.000000 2013-05-10 10.28.54.000000 2009-01-14 09.18.13.000000
and...
AUTHMODE S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR S_ISREG