OBJECT_STATISTICS table function
The OBJECT_STATISTICS table function returns information about objects in a library.
- For an object that is not a user profile:
- If the caller has *EXECUTE authority to the library,
- If the caller has *OBJOPR and *READ authority to an object, full details are returned.
- Otherwise, partial information is returned along with an SQL warning of '01548'.
- If the caller has *EXECUTE authority to the library,
- For a user profile object:
- The caller must have at least one of the following:
- Some authority to the user profile, or
- Authorization to the QIBM_DB_SECADM function usage identifier.
- The caller must have at least one of the following:
- object-schema
- A character or graphic string expression that identifies the name of a library. If the library's
name is a delimited name, the delimited form of the name must be specified. It can be either a long
or short library name.The following special values are allowed for object-schema.
- *ALL
- All libraries.
- *ALLAVL
- All libraries in all available ASPs.
- *ALLUSR
- All user libraries in *SYSBAS and the current thread's ASP group.
- *ALLUSRAVL
- All user libraries in all available ASPs.
- *CURLIB
- The job's current library.
- *LIBL
- The library list.
- *USRLIBL
- The job's current library and the user portion of the library list.
The following special value is allowed for object-schema when object-type-list is '*LIB' or 'LIB'.- *ALLSIMPLE
- The fastest approach to retrieving all user and system library names in *SYSBAS and the current thread's ASP group. Values are returned for the following columns: OBJNAME, OBJLONGNAME, OBJTYPE, OBJLIB, and OBJLONGSCHEMA. All other columns return NULL.
- object-type-list
- A character or graphic string expression containing one or more system object types separated by either a blank or a comma. The object types can include or exclude the leading * character. The special value of '*ALL' or 'ALL' can be used to return all objects in the library object-schema.
- object-name
- A character or graphic string expression that identifies the name of an object or a library. If the object's name is a delimited name, the delimited form of the name must be specified. It can be either a long or short object name. The name must be the valid system name for the object unless the object is a file or a library; for files and libraries the SQL name can be specified.
Column Name | Data Type | Description |
---|---|---|
OBJNAME | VARCHAR(10) | System name of the object. |
OBJTYPE | VARCHAR(8) | System type of the object. |
OBJOWNER | VARCHAR(10) | The user profile that owns the object. Contains the null value if no owner is available. |
OBJDEFINER | VARCHAR(10) | The user profile that created the object. Contains the null value if the object definer is not known. |
OBJCREATED | TIMESTAMP | Timestamp of when the object was created. |
OBJSIZE | DECIMAL(15,0) | Size of the object, in bytes. |
OBJTEXT | VARCHAR(50) | The description of the object. Contains the null value if the object has no text. |
OBJLONGNAME | VARCHAR(128) | The SQL name for the object. For an external procedure or an external function, the name will be returned when a single procedure or function exists for that *PGM or *SRVPGM object. Contains the null value if an SQL name could not be returned. |
LAST_USED_TIMESTAMP | TIMESTAMP | The date the object was used last.
The time portion of the timestamp will always be 0. Contains the null value if the object has not been used. |
LAST_USED_OBJECT | VARCHAR(4) | Indicates whether the LAST_USED_TIMESTAMP value is meaningful for
this object.
|
DAYS_USED_COUNT | INTEGER | The number of days an object has been used on the system. |
LAST_RESET_TIMESTAMP | TIMESTAMP | The date when the days used count
was last reset to zero. The time portion of the timestamp will always
be 0. Contains the null value if the days used count has not been reset. |
IASP_NUMBER | SMALLINT | The auxiliary storage pool (ASP) where storage is allocated for the object. |
OBJATTRIBUTE | VARCHAR(10) | The attribute for this object's
type, if any. Contains an empty string if no attribute. |
OBJLONGSCHEMA | VARCHAR(128) | The SQL schema name for this object. |
TEXT | VARGRAPHIC(50) CCSID 1200 | The description of the object for
*LIB objects. Contains the null value if OBJTYPE is not *LIB. |
SQL_OBJECT_TYPE | VARCHAR(9) | The SQL type of the object. Values
are:
Contains the null value if the object is not an SQL object. |
OBJLIB | VARCHAR(10) | System name of the schema. |
CHANGE_TIMESTAMP | TIMESTAMP | The timestamp of the last time the object was changed. |
USER_CHANGED | VARCHAR(3) | Indicates whether the object was
modified by a user. Values are:
Contains the null value for certain objects that are installed as part of the operating system. |
SOURCE_FILE | VARCHAR(10) | The name of the source file that
was used to create the object. Contains the null value if a source file was not used. |
SOURCE_LIBRARY | VARCHAR(10) | The name of the source file library
that was used to create the object. Contains the null value if a source file was not used. |
SOURCE_MEMBER | VARCHAR(10) | The name of the source file member
that was used to create the object. Contains the null value if a source file was not used. |
SOURCE_TIMESTAMP | TIMESTAMP | The last source update timestamp of the member in the source file
at the time the object was created. Contains the null value if a source file was not used or if the source timestamp is not available. |
CREATED_SYSTEM | VARCHAR(8) | The name of the system on which the object was
created. Contains the null value if the system is not known. |
CREATED_SYSTEM_VERSION | VARCHAR(9) | The version of the operating system when the object was created.
The field has a VxRxMx format where:
Contains the null value if the version is not known. |
LICENSED_PROGRAM | VARCHAR(7) | The name of the licensed program
if the object is part of a licensed program. Contains the null value if the object is not a part of a licensed program. |
LICENSED_PROGRAM_VERSION | VARCHAR(9) | The version number, release level,
and modification level of the licensed program if the object is part
of a licensed program. The field has a VxRxMx format where:
Contains the null value if the object is not a part of a licensed program. |
COMPILER | VARCHAR(7) | The licensed program identifier
of the compiler. Contains the null value if the object was not created with a compiler. |
COMPILER_VERSION | VARCHAR(9) | The licensed program version number,
release level, and modification level of the compiler. The field has
a VxRxMx format where:
Contains the null value if the object was not created with a compiler. |
OBJECT_CONTROL_LEVEL | CHAR(8) | The object control level for the object. Contains the null value if there is no object control level. |
PTF_NUMBER | CHAR(7) | The Program Temporary Fix that resulted in the creation of this
object. Contains the null value for a user created object. |
APAR_ID | CHAR(6) | The authorized program analysis report (APAR) with this
identification number associated with the last change. Will contain the value CHGDFT for a command that is changed using CHGCMDDFT. The Change Object Description (QLICOBJD) API can change this field to any value. Contains the null value is no value is available. |
USER_DEFINED_ATTRIBUTE | VARCHAR(10) | Further defines an object type.
This field is set by the user by using the QLICOBJD API. Contains the null value if the attribute has not been set. |
ALLOW_CHANGE_BY_PROGRAM | VARCHAR(3) | Identifies whether or not any changes other than the text or the
days used count and reset date can be made to the object's description by the Change Object
Description (QLICOBJD) API.
|
CHANGED_BY_PROGRAM | VARCHAR(3) | Identifies whether the object has been modified by the Change
Object Description (QLICOBJD) API.
|
COMPRESSED | VARCHAR(4) | Indicates whether the object is
compressed or decompressed. Values are:
Contains the null value if the object is permanently decompressed and not compressible. |
PRIMARY_GROUP | VARCHAR(10) | The name of the user profile that is the primary group for the
object. Contains the null value if there is no primary group for the object. |
STORAGE_FREED | VARCHAR(3) | The storage status of the object data.
|
ASSOCIATED_SPACE_SIZE | INTEGER | The size, in bytes, of the primary associated space of the
object. Contains the null value if the object has no primary associated space. |
OPTIMUM_SPACE_ALIGNMENT | VARCHAR(3) | Identifies whether the primary associated space for the object
has been optimally aligned. Optimum alignment may allow for better performance of applications that
manipulate the object.
Contains the null value if the object has no associated space. |
OVERFLOW_STORAGE | VARCHAR(3) | Indicates if the object has overflowed the auxiliary storage pool
it resides in.
|
OBJECT_DOMAIN | VARCHAR(7) | The domain that contains the object.
Values are:
|
OBJECT_AUDIT | VARCHAR(10) | The type of auditing for an object.
Values are:
Contains the null value if you do not have either all object (*ALLOBJ) or audit (*AUDIT) special authority. |
OBJECT_SIGNED | VARCHAR(3) | Indicates whether the object has
a digital signature.
|
SYSTEM_TRUSTED_SOURCE | VARCHAR(3) | Indicates whether the object is
signed by a source that is trusted by the system.
|
MULTIPLE_SIGNATURES | VARCHAR(3) | Indicates whether the object has
more than one digital signature.
|
SAVE_TIMESTAMP | TIMESTAMP | The timestamp the object was last
saved. Contains the null value if the object has not been saved. |
RESTORE_TIMESTAMP | TIMESTAMP | The timestamp the object was last
restored. Contains the null value if the object has not been restored. |
SAVE_WHILE_ACTIVE_TIMESTAMP | TIMESTAMP | The timestamp at which the object
was saved while active. Contains the null value if the object has not been saved while active. |
SAVE_COMMAND | VARCHAR(10) | The command used to save the object. Contains the null value if the object has not been saved. |
SAVE_DEVICE | VARCHAR(5) | The type of the device to which
the object was last saved. Valid values are:
Contains the null value if the object has not been saved. |
SAVE_FILE_NAME | VARCHAR(10) | The save file used to save the
object. Contains the null value if the object was not last saved to a save file. |
SAVE_FILE_LIBRARY | VARCHAR(10) | The save file library used to save
the object. Contains the null value if the object was not last saved to a save file. |
SAVE_VOLUME | VARCHAR(71) | The tape or optical volumes used
to save the object. A maximum of ten volumes is returned. The string
contains one blank between volume identifiers. If more than ten volumes
were used, an ellipsis (three periods) is returned to the right of
the identifier of the tenth volume. Contains the null value if the object was not last saved to tape or optical. |
SAVE_LABEL | VARCHAR(17) | The file label used when the object
was saved to tape or optical. Contains the null value if the object was not last saved to tape or optical. |
SAVE_SEQUENCE_NUMBER | DECIMAL(10,0) | The sequence number used to when
the object was saved to tape. Contains the null value if the object was not last saved to tape. |
LAST_SAVE_SIZE | DECIMAL(15,0) | The size of the object in bytes
at the time of the last save. This value defines the amount of storage
that is required if the object is restored. Contains the null value if the object has not been saved. |
JOURNALED | VARCHAR(3) | Identifies the current journaling
status of the object. Valid values are:
|
JOURNAL_NAME | VARCHAR(10) | The name of journal that receives
the journaled changes or the name of the last journal if the object
is not currently journaled. Contains the null value if the object has not been journaled. |
JOURNAL_LIBRARY | VARCHAR(10) | The name of journal library that
receives the journaled changes or the name of the last journal library
if the object is not currently journaled. Contains the null value if the object has not been journaled. |
JOURNAL_IMAGES | VARCHAR(6) | Specifies the kinds of images that
are generated for changes to the object. Valid values are:
Contains the null value if the object has not been journaled. |
OMIT_JOURNAL_ENTRY | VARCHAR(7) | Specifies the journal entries that
are omitted. Valid values are:
Contains the null value if the object has not been journaled. |
REMOTE_JOURNAL_FILTER | VARCHAR(3) | The remote journal filter value
for the object. Valid values are:
Contains the null value if the object has not been journaled. |
JOURNAL_START_TIMESTAMP | TIMESTAMP | The timestamp journaling was last
started. Contains the null value if the object has not been journaled. |
APPLY_STARTING_RECEIVER | VARCHAR(10) | Specifies the name of the oldest
journal receiver needed to successfully use the Apply Journaled Changes
(APYJRNCHG) or Remove Journaled Changes (RMVJRNCHG) command. Contains the null value if the object has not been journaled or it has not been saved and restored since journaling was started. |
APPLY_STARTING_RECEIVER_LIBRARY | VARCHAR(10) | Specifies the library name of the
oldest journal receiver needed to successfully use the Apply Journaled
Changes (APYJRNCHG) or Remove Journaled Changes (RMVJRNCHG) command. Contains the null value if the object has not been journaled or it has not been saved and restored since journaling was started. |
Example
- Find all journals in library
MJATST.
orSELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('MJATST ','JRN') ) AS X
SELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('MJATST ','*JRN') ) AS X
- Find all journals and journal receivers in library MJATST.
orSELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('MJATST ','JRN JRNRCV') ) AS X
SELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('MJATST ','*JRN *JRNRCV') ) AS X
- Find all programs and service programs in library MYLIB. Use *ALLSIMPLE to return
the list quickly, omitting the detail
information.
SELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('MYLIB','PGM SRVPGM','*ALLSIMPLE')) X
- Find any CL commands that have had their parameter defaults
changed.
SELECT * FROM TABLE(QSYS2.OBJECT_STATISTICS('QSYS', '*CMD')) WHERE APAR_ID = 'CHGDFT';