IFS_OBJECT_STATISTICS table function
The IFS_OBJECT_STATISTICS table function returns a table of objects contained in the starting path name or accessible from the starting path name.
This information is similar to what is returned by the Retrieve Directory Information (RTVDIRINF) command or the Qp0lGetAttr()--Get Attributes API.
No rows are returned for remote file system objects. This means that for the QNTC file system, only a row for /QNTC is returned. For the Network File System (NFS) and QFileSvr.400 file systems, no rows are returned.
Some file systems, including QDLS, are not threadsafe. Accessing information from these file systems might not return some rows. If this happens, an error or warning is returned based on the IGNORE_ERRORS parameter setting. See the Usage Notes on this page for the list of threadsafe file systems: access()--Determine File Accessibility.
Authorization: The caller must have:
- For each directory included in the path name used to start the search, *X
- For each directory processed recursively, *RX and *OBJMGT
- For each object returned, *OBJMGT
- For each directory included in the path name, except for QDLS, used to start the search, *X
- For every object being returned or processed recursively, *RWX and *OBJEXIST *OBJMGT *OBJALTER *OBJREF
- For the library or object included in the path name used to start the search, *USE
- For each library or object processed recursively by the service, *USE and *OBJMGT
- For each object returned, *OBJMGT
To return values for OBJECT_AUDIT and OBJECT_AUDIT_CREATE, the caller must have *ALLOBJ or *AUDIT special authority.
- start-path-name
- An expression that returns a path name for starting the search. A relative path name is relative to the current directory. If an absolute path name is not specified, the current working directory is used in combination with the relative path name to resolve to the object.
- subtree-directories
- An expression that indicates whether all subdirectories should be recursively processed or not.
- NO
- Only objects in the directory identified by start-path-name are processed.
- YES
- All subdirectories for the directory identified by start-path-name are processed. This is the default.
- object-type-list
- A list of one or more object types that should be returned. One or more blanks separate multiple
values. The default is the empty string, indicating all objects are returned. Values include all the
standard system object types, for example *PGM or *STMF, and the following special values:
- *ALLDIR
-
Select all directory object types. This includes *LIB, *DIR, *FLR, *FILE, and *DDIR object types.
- *ALLSTMF
- Select all stream file object types. This includes *MBR, *DOC, *STMF, *DSTMF, and *USRSPC object types.
- *MBR
-
Select all database file member types.
- *NOQDLS
- Exclude all QDLS file system object types.
- *NOQOPT
- Exclude all QOPT and QNTC file system object types.
- *NOQSYS
- Exclude all QSYS.LIB object types. This includes all objects in the QSYS.LIB file system and all independent ASP QSYS.LIB file systems which are available when the function is invoked.
- omit-list
- A character string containing one or more path names to exclude from processing. All objects and sub directories accessed from this path are excluded as well. The default is the empty string, indicating no path names are excluded from processing.
- ignore-errors
-
A character or graphic string expression that identifies what to do when an error is encountered.
- NO
-
An error is returned.
- YES
- A warning is returned.
The result of the function is a table containing rows with the format shown in the following table. All the columns are nullable.
Column Name | Data Type | Description |
---|---|---|
PATH_NAME | DBCLOB(16M) CCSID 1200 | The path name of an integrated file system object. |
OBJECT_TYPE | VARCHAR(10) | The object type. |
SYMBOLIC_LINK | DBCLOB(16M) CCSID 1200 | The symbolic link for this object. Contains the null value if OBJECT_TYPE is not *SYMLNK. |
ASP_NUMBER | INTEGER | The auxiliary storage pool (ASP) in which the object is
stored. Contains the null value if the object does not reside on this IBM® i. |
TEXT_DESCRIPTION | VARGRAPHIC(50) CCSID 1200 | The text string associated with the object. Contains the null value if there is no text string. |
FILE_IDENTIFIER_NUMBER | BIGINT | The file identifier number of the object. This number uniquely
identifies the object with a file system. The file identifier number, generation identifier, and file system identifier used together uniquely identify the object on the system. |
GENERATION_IDENTIFIER | BIGINT | The generation identifier associated with the object. The file identifier number, generation identifier, and file system identifier used together uniquely identify the object on the system. |
FILE_SYSTEM_IDENTIFIER | BIGINT | The file system ID to which the object belongs. This number
uniquely identifies the file system to which the object belongs. The file identifier number, generation identifier, and file system identifier used together uniquely identify the object on the system. |
FILE_IDENTIFIER | BINARY(16) | An identifier associated with the referred to object. |
FILE_ACCESS | BINARY(4) | Bit string containing information including the file type and file mode |
CREATE_TIMESTAMP | TIMESTAMP(0) | The time the object was created. |
ACCESS_TIMESTAMP | TIMESTAMP(0) | The time that the object's data was last accessed. Contains the null value if the object has never been accessed. |
DATA_CHANGE_TIMESTAMP | TIMESTAMP(0) | The time that the object's data was last changed. Contains the null value if the object's data has never been changed. |
OBJECT_CHANGE_TIMESTAMP | TIMESTAMP(0) | The time that the object's data or attributes were last
changed. Contains the null value if the object's data or attributes have never been changed. |
LAST_USED_TIMESTAMP | TIMESTAMP(0) | The date the object was last used. Contains the null value if the object has never been used or if usage data is not maintained for the IBM i type or the file system to which an object belongs. |
DAYS_USED_COUNT | INTEGER | The number of days an object has been used. Usage has different meanings according to the specific file system and according to the individual object types supported within a file system. Usage can indicate the opening or closing of a file or can refer to adding links, renaming, restoring, or checking out an object. This count is incremented once each day that an object is used and can be reset. |
LAST_RESET_TIMESTAMP | TIMESTAMP(0) | The timestamp when the days used count was last reset to
zero. Contains the null value if the days used count has never been reset. |
ALLOCATED_SIZE | BIGINT | The number of bytes that have been allocated for this object. |
DATA_SIZE | BIGINT | The size, in bytes, of the data in this object. This size does not include object headers or the size of extended attributes associated with the object. |
CCSID | INTEGER | The CCSID of the data and extended attributes of the
object. Contains the null value if there is no CCSID. |
CODE_PAGE | INTEGER | The code page derived from the coded character set identifier
(CCSID) used for the data in the file or the extended attributes of the directory. Contains the null value if there is more than one code page or if the CCSID is not a supported CCSID. |
EXTENDED_ATTRIBUTE_COUNT | BIGINT | Number of extended attributes associated with this object. |
CRITICAL_EXTENDED_ATTRIBUTE_COUNT | BIGINT | Number of critical extended attributes associated with this object. |
EXTENDED_ATTRIBUTE_SIZE | BIGINT | The total number of extended attribute bytes. |
HARD_LINK_COUNT | INTEGER | The number of hard links to the object. |
OBJECT_READ_ONLY | VARCHAR(3) | Whether the object can be written to or deleted, have its
extended attributes changed or deleted, or have its size changed.
|
OBJECT_HIDDEN | VARCHAR(3) | Whether the object can be displayed using an ordinary directory
listing.
|
TEMPORARY_OBJECT | VARCHAR(3) | Whether the object is a temporary object.
|
SYSTEM_FILE | VARCHAR(3) | Whether the object is a system file and is excluded from normal
directory searches.
|
SYSTEM_USAGE | VARCHAR(6) | Whether the file has a special use by the system.
Contains the null value if OBJECT_TYPE is not *STMF. |
DEVICE_SPECIAL_FILE | BIGINT | It the object is a device special file, the real device it
represents. Contains the null value if this is not a device special file. |
OBJECT_OWNER | VARCHAR(10) | The name of the user profile that is the owner of the object. Can
contain the following special value:
Contains the null value if there is no owner. |
USER_ID_NUMBER | BIGINT | User ID (UID) number of the owner of the object. Contains the null value if there is no owner. |
PRIMARY_GROUP | VARCHAR(10) | The name of the user profile that is the primary group of the
object. Can contain the following special value:
Contains the null value if the object has no primary group. |
GROUP_ID_NUMBER | BIGINT | Group ID (GID) number of the user profile that is the primary
group of the object. Contains the null value if the object has no primary group. |
AUTHORIZATION_LIST | VARCHAR(10) | The name of the authorization list that is used to secure the
named object. Contains the null value if no authorization list is used in determining authority to the object. |
SET_EFFECTIVE_USER_ID | VARCHAR(3) | Set effective user ID (UID) at execution time.
|
SET_EFFECTIVE_GROUP_ID | VARCHAR(3) | Set effective group ID (GID) at execution time.
|
AUTHORITY_COLLECTION_VALUE | VARCHAR(10) | Specifies the authority collection value used for the object when
authority collection for objects is active.
|
OBJECT_AUDIT | VARCHAR(7) | The auditing value associated with the object.
Contains the null value if the user is not allowed to retrieve the current auditing value. |
OBJECT_AUDIT_CREATE | VARCHAR(7) | The create object auditing value associated with the directory.
This is the auditing value given to any objects created in the directory.
Contains the null value if the user is not allowed to retrieve the current create object auditing value. |
JOURNALED | VARCHAR(3) | Current journaling status of the object.
|
JOURNAL_LIBRARY | VARCHAR(10) | The name of the library containing the journal currently being
used . Contains the null value if the object is not journaled. |
JOURNAL_NAME | VARCHAR(10) | The name of the journal currently being used. Contains the null value if the object is not journaled. |
JOURNAL_BEFORE_IMAGE | VARCHAR(3) | Indicates whether the image of the object before a change is
journaled when journaling is active.
Contains the null value if the object has never been journaled. |
JOURNAL_AFTER_IMAGE | VARCHAR(3) | Indicates whether the image of the object after a change is
journaled when journaling is active.
Contains the null value if the object has never been journaled. |
JOURNAL_IDENTIFIER | VARCHAR(10) | The journal identifier (JID) for this object. Contains the null value if the object has never been journaled. |
JOURNAL_START_TIMESTAMP | TIMESTAMP(0) | The timestamp when the object had most recently had journaling
started for it. Contains the null value if the object has never been journaled. |
JOURNAL_OPTIONAL_ENTRIES | VARCHAR(3) | When journaling is active, entries that are considered optional
are journaled. The list of optional journal entries varies for each object type. See Integrated file system for
information regarding these optional entries for various objects.
Contains the null value if the object has never been journaled. |
JOURNAL_SUBTREE | VARCHAR(3) | Indicates whether this object is a directory or library with
inherit journal semantics.
Contains the null value if the object has never been journaled. |
PARTIAL_TRANSACTION | CHAR(1) | Indicates whether the object contains a partial transaction:
Contains the null value if the object has never been journaled. |
APPLY_STARTING_RECEIVER_LIBRARY | VARCHAR(10) | The name of the library that contains the journal
receiver. Contains the null value if the object has never been journaled. |
APPLY_STARTING_RECEIVER | VARCHAR(10) | The oldest journal receiver needed to successfully Apply
Journaled Changes (APYJRNCHG). If PARTIAL_TRANSACTION has a value of Y, the journal receiver
contains the journal entries representing the start of the partial transaction. Otherwise; the
journal receiver contains the journal entries representing the start-of-the-save
operation. Contains the null value if PARTIAL_TRANSACTION has a value of R. Also contains the null value if the object has never been journaled. |
APPLY_STARTING_RECEIVER_ASP | VARCHAR(10) | The name of the ASP for the library that contains the starting
journal receiver. Can contain the special value *SYSBAS. Contains the null value if the object has never been journaled. |
OBJECT_SIGNED | VARCHAR(3) | Whether an object has a digital signature.
Contains the null value if OBJECT_TYPE is not *STMF. |
SYSTEM_TRUSTED_SOURCE | VARCHAR(3) | Whether the object was signed by a source that is trusted by the
system.
Contains the null value if OBJECT_TYPE is not *STMF or if OBJECT_SIGNED is NO. |
MULTIPLE_SIGNATURES | VARCHAR(3) | Whether an object has more than one digital signature.
Contains the null value if OBJECT_TYPE is not *STMF or if OBJECT_SIGNED is NO. |
OBJECT_DOMAIN | VARCHAR(7) | The domain of the object.
|
BLOCK_SIZE | INTEGER | The block size of the object. |
AUX_STORAGE_ALLOCATION | VARCHAR(8) | Determines how auxiliary storage is allocated by the system for
the specified object.
Contains the null value if OBJECT_TYPE is not *STMF. |
AUX_STORAGE_OVERFLOW | VARCHAR(3) | Whether the object has overflowed the auxiliary storage pool it
resides in.
|
MAIN_STORAGE_ALLOCATION | VARCHAR(8) | Determines how main storage is allocated by the system for the
specified object.
Contains the null value if OBJECT_TYPE is not *STMF. |
STORAGE_FREED | VARCHAR(3) | Whether the object's data has been moved offline, freeing its
online storage.
|
STORED_LOCAL | VARCHAR(3) | Indicates whether an object is stored locally or stored on a
remote system. The decision of whether a file is local or remote varies according to the respective
file system rules. Objects in file systems that do not carry either a local or remote indicator are
treated as remote.
|
VIRTUAL_DISK_STORAGE | VARCHAR(3) | Whether the object is the storage which was allocated for
Integrated xSeries servers to use as virtual disk drives for the xSeries servers.
Contains the null value if OBJECT_TYPE is not *STMF. |
DIRECTORY_FORMAT | CHAR(6) | The format of the specified directory object.
Contains the null value if OBJECT_TYPE is not *DIR. |
STREAM_FILE_FORMAT | CHAR(6) | The format of the stream file.
Contains the null value if OBJECT_TYPE is not *STMF. |
UDFS_FILE_FORMAT | CHAR(6) | The default file format of stream files (*STMF) created in the
user-defined file system.
Contains the null value if OBJECT_TYPE is not *STMF. |
UDFS_PREFERRED_STORAGE | CHAR(3) | The preferred storage media for the objects in the UDFS.
Contains the null value if the preferred storage media is not known. |
UDFS_TEMPORARY_OBJECT | VARCHAR(3) | Whether the objects in the UDFS are temporary objects.
|
CASE_SENSITIVE_FILE_SYSTEM | VARCHAR(3) | The case sensitivity of the file system that contains this object.
|
RESTRICT_RENAME_AND_UNLINK | VARCHAR(3) | Restricted renames and unlinks for objects within a directory. Objects can be linked into a
directory that has this attribute set on, but cannot be renamed or unlinked from it unless one or
more of the following are true for the user performing the operation:
|
PC_ARCHIVE | VARCHAR(3) | Whether the object has changed since the last time it was saved
on the PC.
|
SYSTEM_ARCHIVE | VARCHAR(3) | Whether the object has changed and needs to be saved on the IBM i. The value will be YES when an object's change time is updated, and set to NO when the object has been saved.
|
ALLOW_SAVE | VARCHAR(3) | Whether the object can be saved or not.
|
SYSTEM_RESTRICT_SAVE | VARCHAR(3) | Whether the system prevents the object from being saved.
|
INHERIT_ALLOW_CHECKPOINT_WRITER | VARCHAR(3) | Whether new objects created within a directory should inherit the
save-while-active checkpoint processing options of its parent.
|
ALLOW_WRITE_DURING_SAVE | VARCHAR(3) | If the object is a stream file, indicates whether the stream file
can be shared with readers and writers during save-while-active checkpoint processing. If the object
is a directory, indicates whether links can be added, removed, or renamed in the directory during a
save-while-active operation.
Contains the null value if OBJECT_TYPE is not *STMF or *DIR. |
EXIT_PROGRAM_OPEN_CLOSE | VARCHAR(3) | Whether exit programs registered with any of the integrated file
system open-related exit programs will be called when the object is opened or closed. This is the
run exit program value for the object.
|
EXIT_PROGRAM_OPEN_CLOSE_DIRECTORY | VARCHAR(3) | The run exit program value used when objects are created
in this directory. This is also the create run exit program value for the directory.
Contains the null value if OBJECT_TYPE is not *DIR. |
EXIT_PROGRAM_SCAN | VARCHAR(11) | Whether the object will be scanned when exit programs are
registered with any of the integrated file system scan-related exit points.
Contains the null value if OBJECT_TYPE is not *STMF. |
EXIT_PROGRAM_SCAN_DIRECTORY | VARCHAR(11) | Whether the objects created in a directory will be scanned when
exit programs are registered with any of the integrated file system scan-related exit points.
Contains the null value if OBJECT_TYPE is not *DIR. |
SCAN_STATUS | VARCHAR(12) | The scan status associated with this object.
|
CCSID_SCAN | INTEGER | A CCSID value that the object has been scanned in if it was
previously scanned in a CCSID. If SCAN_STATUS is SUCCESS, the object was successfully scanned in
this CCSID. If SCAN_STATUS is FAILURE, the object failed the scan in this CCSID. Contains the null value if no CCSID applies. |
CCSID_SCAN_SUCCESS | INTEGER | If SCAN_STATUS is SUCCESS, the object was successfully scanned in
this CCSID. Contains the null value if the SCAN_STATUS is FAILURE or if CCSID_SCAN is the null value. |
SCAN_SIGNATURES_DIFFERENT | VARCHAR(3) | When an object is in an independent ASP group, the object scan
signature is compared to the associated independent ASP group scan signature. When an object is not
in an independent ASP group, the object scan signature is compared to the global scan signature value.
|
BINARY_SCAN | VARCHAR(3) | The object was scanned in binary mode when it was previously scanned.
|
CHECKED_OUT | VARCHAR(3) | Whether the object is checked out.
|
CHECKED_OUT_TIMESTAMP | TIMESTAMP(0) | The time the object was checked out. Contains the null value if the object is not checked out. |
CHECKED_OUT_USER | VARCHAR(10) | The user who has the object checked out. Contains the null value if the object is not checked out. |
Example
- List basic information for all the objects in directory
/usr.
SELECT PATH_NAME, OBJECT_TYPE, DATA_SIZE, OBJECT_OWNER FROM TABLE (QSYS2.IFS_OBJECT_STATISTICS(START_PATH_NAME => '/usr', SUBTREE_DIRECTORIES => 'NO'));
- List basic information for all the objects in /usr, processing all subdirectories as
well.
SELECT PATH_NAME, OBJECT_TYPE, DATA_SIZE, OBJECT_OWNER FROM TABLE (QSYS2.IFS_OBJECT_STATISTICS(START_PATH_NAME => '/usr', SUBTREE_DIRECTORIES => 'YES'));