SYSPROGRAMSTAT

The SYSPROGRAMSTAT view contains one row for each program, service program, and module that contains SQL statements.

The following table describes the columns in the SYSPROGRAMSTAT view:

Table 1. SYSPROGRAMSTAT view
Column Name System Column Name Data Type Description
PROGRAM_SCHEMA COLLID VARCHAR(128) Name of the schema
PROGRAM_NAME NAME VARCHAR(128) Name of the program, service program, or module. For an SQL procedure, function, or trigger, this is the SQL object name.
PROGRAM_TYPE PGMTYPE VARCHAR(128) Type of the object
*PGM
The object is a program.
*MODULE
The object is a module.
*SRVPGM
The object is a service program.
Start of changeMODULE_NAMEEnd of change Start of changeMODNAMEEnd of change Start of changeVARCHAR(10)
Nullable
End of change
Start of changeModule name for ILE program or service program.

Contains the null value if this is not an ILE program or service program.

End of change
PROGRAM_OWNER OWNER VARCHAR(128) Owner of the program, service program, or module
PROGRAM_CREATOR CREATOR VARCHAR(128) Creator of the program, service program, or module
CREATION_TIMESTAMP TIMESTAMP TIMESTAMP Timestamp of when the program, service program, or module was created
DEFAULT_SCHEMA QUALIFIER VARCHAR(128)
Nullable
Implicit name for unqualified tables, views, and indexes.

Start of changeContains null if a default schema was not specified (DFTRDBCOL) or if the program is an external procedure without SQL statements.End of change

ISOLATION ISOLATION CHAR(2)
Start of changeNullableEnd of change
Isolation option specification:
RR
Repeatable Read (*RR)
RS
Read Stability (*ALL)
CS
Cursor Stability (*CS)
UR
Uncommitted Read (*CHG)
NC
No Commit (*NONE)

Start of changeContains null if the program is an external procedure without SQL statements.End of change

CONCURRENTACCESSRESOLUTION CONCURRENT CHAR(1)
Start of changeNullableEnd of change
Specifies the concurrent access resolution:
blank
Not specified
W
Wait for outcome
U
Use currently committed

Start of changeContains null if the program is an external procedure without SQL statements.End of change

NUMBER_STATEMENTS NBRSTMTS INTEGER Number of SQL statements in the program, service program or module
PROGRAM_USED_SIZE PGMSIZE INTEGER Number of bytes that are used for SQL statements and access plans in the program, service program or module.
NUMBER_COMPRESSIONS PGM_CMP
Start of changeNullableEnd of change
INTEGER
Nullable
Number of times the program or service program has been compressed.

Contains null for modules Start of changeor if the program is an external procedure without SQL statements.End of change

STATEMENT_CONTENTION_COUNT CONTENTION BIGINT
Nullable
Number of times contention occurred when attempting to store a new access plan.

Contains null for modules Start of changeor if the program is an external procedure without SQL statements.End of change

ORIGINAL_SOURCE_FILE SOURCE VARCHAR(128)
Nullable
The fully qualified source file and member that was used to create the program or module.

Contains null for SQL routines Start of changeor if the program is an external procedure without SQL statements.End of change

ORIGINAL_SOURCE_FILE_CCSID SRC_CCSID INTEGER
Nullable
The CCSID of the source file that was used to create the program or module.

Contains null for SQL routines Start of changeor if the program is an external procedure without SQL statements.End of change

ROUTINE_TYPE RTNTYPE VARCHAR(9)
Nullable
Type of the routine.
PROCEDURE
This is a procedure.
FUNCTION
This is a function.
TRIGGER
This is a trigger.

Contains null for modules or if the program or service program is not a procedure, function, or trigger. An external procedure will not be identified as PROCEDURE unless NUMBER_EXTERNAL_ROUTINES is greater than zero.

ROUTINE_BODY BODY VARCHAR(8)
Nullable
The type of the routine body:
EXTERNAL
This is an external routine.
SQL
This is an SQL routine.

Contains null for modules or if the program or service program is not a procedure or function.

FUNCTION_ORIGIN ORIGIN CHAR(1)
Nullable
Identifies the type of function. If this is a procedure, this column contains a blank.
B
This is a built-in function (defined by Db2® for i).
E
This is a user-defined function.
U
This is a user-defined function that is sourced on another function.
S
This is a system-generated function.

Contains null for modules or if the program or service program is not a procedure or function.

FUNCTION_TYPE TYPE CHAR(1)
Nullable
Identifies the form of the function. If this is a procedure, this column contains a blank.
S
This is a scalar function.
C
This is a column function.
T
This is a table function.

Contains null for modules or if the program or service program is not a procedure, function, or trigger.

NUMBER_EXTERNAL_ROUTINES NBREXTRTN SMALLINT
Nullable
Indicates the number of procedure and function definitions stored in the program or service program.

Contains null for modules, triggers, or SQL routines.

EXTENDED_INDICATOR EXTIND VARCHAR(9)
Start of changeNullableEnd of change
Indicates the EXTIND attribute:
*EXTIND
Extended indicator support is enabled.
*NOEXTIND
Extended indicator support is not enabled.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

C_NUL_REQUIRED CNULRQD VARCHAR(10)
Start of changeNullableEnd of change
Indicates the CNULRQD attribute:
*CNULRQD
C nuls are required.
*NOCNULRQD
C nuls are not required.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

NAMING NAMING VARCHAR(4)
Start of changeNullableEnd of change
Indicates the NAMING attribute:
*SYS
This is system naming.
*SQL
This is SQL naming.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

TARGET_RELEASE TGTRLS VARCHAR(6)
Start of changeNullableEnd of change
Indicates the target release of the program, service program, or module (VxRxMx).

Start of changeContains null if the program is an external procedure without SQL statements.End of change

Start of changeEARLIEST_POSSIBLE_RELEASEEnd of change Start of changeMINRLSEnd of change Start of changeVARCHAR(6)
Nullable
End of change
Start of changeIndicates the earliest IBM i release that supports all the SQL statements in the program, service program, or module (VxRxMx).
ANY
The statements are valid on any supported IBM i release.
VxRxMx
The statement is valid on IBM i VxRxMx release or later.

Start of changeContains null if the earliest release has not yet been determined or if the program is an external procedure without SQL statements.End of change

End of change
RDB RDB VARCHAR(18)
Start of changeNullableEnd of change
Indicates the RDB specified for the program, service program, or module.
rdb-name
The name of the relational database.
*NONE
A relational database was not specified.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

Start of changeCONSISTENCY_TOKENEnd of change Start of changeCONTOKENEnd of change Start of changeVARBINARY(8)
Nullable
End of change
Start of changeIndicates the consistency token of the program.

Contains null if the program is an external procedure without SQL statements.

End of change
ALLOW_COPY_DATA ALWCPYDTA VARCHAR(9)
Start of changeNullableEnd of change
Indicates the ALWCPYDTA attribute:
*NO
A copy of the data is not allowed.
*OPTIMIZE
A copy of the data is allowed whenever it might result in better performance.
*YES
A copy of the data is allowed, but only when necessary.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

CLOSE_SQL_CURSOR CLOSQLCSR VARCHAR(10)
Start of changeNullableEnd of change
Indicates the CLOSQLCSR attribute:
*ENDACTGRP
SQL cursors are closed and SQL prepared statements are implicitly discarded, and LOCK TABLE locks are released when the activation group ends.
*ENDJOB
SQL cursors are closed and SQL prepared statements are implicitly discarded, and LOCK TABLE locks are released when the job ends.
*ENDMOD
SQL cursors are closed and SQL prepared statements are implicitly discarded when the module is exited. LOCK TABLE locks are released when the first SQL program on the call stack ends.
*ENDPGM
SQL cursors are closed and SQL prepared statements are implicitly discarded when the program ends. LOCK TABLE locks are released when the first SQL program on the call stack ends.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

Start of changeLOB_FETCH_OPTIMIZATIONEnd of change Start of changeOPTLOBEnd of change Start of changeVARCHAR(9)End of change Start of changeIndicates the LOB optimization attribute:
*OPTLOB
The first FETCH for a cursor determines how the cursor will be used for LOB and XML result columns on all subsequent FETCHes.
*NOOPTLOB
Any FETCH may retrieve a LOB or XML result column into either a locator or variable.
End of change
Start of changeDECIMAL_POINTEnd of change Start of changeDECPNTEnd of change Start of changeVARCHAR(7)End of change Start of changeIndicates the decimal point for numeric constants used in SQL statements.
*PERIOD
The decimal point is a period.
*COMMA
The decimal point is a comma.
End of change
Start of changeSQL_STRING_DELIMITEREnd of change Start of changeSTRDLMEnd of change Start of changeVARCHAR(9)End of change Start of changeIndicates the character used as the string delimiter in the SQL statements.
*APOSTSQL
The string delimiter is an apostrophe (').
*QUOTESQL
The string delimiter is a quote (").
End of change
DATE_FORMAT DATFMT VARCHAR(4)
Start of changeNullableEnd of change
Indicates the DATFMT attribute:
*JOB
The date format specified in the job at runtime is used.
*USA
The date format is *USA.
*ISO
The date format is *ISO.
*EUR
The date format is *EUR.
*JIS
The date format is *JIS.
*MDY
The date format is *MDY.
*DMY
The date format is *DMY.
*YMD
The date format is *YMD.
*JUL
The date format is *JUL.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DATE_SEPARATOR DATSEP CHAR(1)
Start of changeNullableEnd of change
Indicates the date separator.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

TIME_FORMAT TIMFMT VARCHAR(4)
Start of changeNullableEnd of change
Indicates the TIMFMT attribute:
*JOB
The time format specified in the job at runtime is used.
*USA
The time format is *USA.
*ISO
The time format is *ISO.
*EUR
The time format is *EUR.
*JIS
The time format is *JIS.
*HMS
The date format is *HMS.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

TIME_SEPARATOR TIMSEP CHAR(1)
Start of changeNullableEnd of change
Indicates the time separator.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DYNAMIC_DEFAULT_SCHEMA DYNDFTCOL VARCHAR(4)
Nullable
Indicates whether the value for DFTRDBCOL should be used for implicit qualification on dynamic SQL statements:
*NO
The schema specified in DFTDRBCOL is not used for dynamic SQL statements.
*YES
The schema specified in DFTDRBCOL is used for dynamic SQL statements.

Start of changeContains null if a default schema was not specified (DFTRDBCOL) or if the program is an external procedure without SQL statements.End of change

CURRENT_RULES SQLCURRULE VARCHAR(4)
Start of changeNullableEnd of change
Indicates the SQLCURRULE attribute:
*DB2
The semantics of all SQL statements will default to the rules established for DB2®.
*STD
The semantics of all SQL statements will default to the rules established by the ISO and ANSI SQL standards.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

ALLOW_BLOCK ALWBLK VARCHAR(8)
Start of changeNullableEnd of change
Indicates the ALWBLK attribute:
*ALLREAD
Rows are blocked for read-only cursors.
*NONE
Rows are not blocked for retrieval of data for cursors.
*READ
Records are blocked for read-only retrieval of data for cursors when:
  • *NONE is specified for the Commitment control (COMMIT) parameter.
  • The cursor is declared with a FOR READ ONLY clause or there are no dynamic statements that could run a positioned UPDATE or DELETE statement for the cursor.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DELAY_PREPARE DLYPRP VARCHAR(4)
Start of changeNullableEnd of change
Indicates the DLYPRP attribute:
*NO
Dynamic statement validation is performed when the dynamic statements are prepared.
*YES
Dynamic statement validation is delayed until the dynamic statements are used.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

USER_PROFILE USRPRF VARCHAR(7)
Start of changeNullableEnd of change
Specifies the user profile used for authority checking:
*USER
The profile of the user running the program is used.
*OWNER
The profiles of both the owner of the program and the user running the program is used.
*NAMING
If the naming convention is *SQL, *OWNER is used. If the naming convention is *SYS, *USER is used.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DYNAMIC_USER_PROFILE DYNUSRPRF VARCHAR(6)
Start of changeNullableEnd of change
Specifies the user profile used for dynamic SQL statements:
*USER
Local dynamic SQL statements are run under the profile of the job or thread. Distributed dynamic SQL statements are run under the profile of the application server job.
*OWNER
Local dynamic SQL statements are run under the profile of the program's owner. Distributed dynamic SQL statements are run under the profile of the SQL package's owner.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

SORT_SEQUENCE SRTSEQ VARCHAR(12)
Start of changeNullableEnd of change
Indicates whether the program, service program, or module uses a collating sequence:
BY HEX VALUE
The SQL index does not use a collating table.
*LANGIDSHR
The SQL index uses a shared weight sort sequence (SRTSEQ).
*LANGIDUNQ
The SQL index uses a unique weight sort sequence (SRTSEQ).
ALTSEQ
The SQL index uses an alternate collating sequence (ALTSEQ).

Start of changeContains null if the program is an external procedure without SQL statements.End of change

LANGUAGE_IDENTIFIER LANGID CHAR(3)
Nullable
The language ID sort sequence.

Start of changeContains null if the sort sequence is not *LANGIDSHR or *LANGIDUNQ or if the program is an external procedure without SQL statements.End of change

SORT_SEQUENCE_SCHEMA SRTSEQSCH CHAR(10)
Nullable
The sort sequence table system schema.

Start of changeContains null if the sort sequence is hex or if the program is an external procedure without SQL statements.End of change

SORT_SEQUENCE_NAME SRTSEQNAME CHAR(10)
Nullable
The sort sequence table name.

Start of changeContains null if the sort sequence is hex or if the program is an external procedure without SQL statements.End of change

RDB_CONNECTION_METHOD RDBCNNMTH VARCHAR(4)
Start of changeNullableEnd of change
Specifies the semantics used for CONNECT statements:
*RUW
CONNECT (Type 1) semantics are used to support remote unit of work.
*DUW
CONNECT (Type 2) semantics are used to support distributed unit of work.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DECRESULT_MAXIMUM_PRECISION DECMAXPRC SMALLINT
Start of changeNullableEnd of change
Specifies the maximum precision.
31
The maximum precision is 31.
63
The maximum precision is 63.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DECRESULT_MAXIMUM_SCALE DECMAXSCL SMALLINT
Start of changeNullableEnd of change
The maximum scale (number of decimal positions to the right of the decimal point) that should be returned for result data types.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DECRESULT_MINIMUM_DIVIDE_SCALE DECMINDIV SMALLINT
Start of changeNullableEnd of change
The minimum divide scale (number of decimal positions to the right of the decimal point) that should be returned for both intermediate and result data types.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DECFLOAT_ROUNDING_MODE DECFLTRND VARCHAR(8)
Start of changeNullableEnd of change
Indicates the DECFLOAT rounding mode:
CEILING
ROUND_CEILING
DOWN
ROUND_DOWN
FLOOR
ROUND_FLOOR
HALFDOWN
ROUND_HALF_DOWN
HALFEVEN
ROUND_HALF_EVEN
HALFUP
ROUND_HALF_UP
UP
ROUND_UP

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DECFLOAT_WARNING DECFLTWRN VARCHAR(3)
Start of changeNullableEnd of change
Indicates whether DECFLOAT warnings are returned.
NO
DECFLOAT warnings are not returned.
YES
DECFLOAT warnings are returned.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

SQLPATH SQLPATH VARCHAR(3483)
Nullable
Identifies the SQL path.

Contains the null value if an SQL path is not specified Start of changeor if the program is an external procedure without SQL statements.End of change

DBGVIEW DBGVIEW VARCHAR(9)
Start of changeNullableEnd of change
Specifies the type of source debug information:
*NONE
No debug.
*SOURCE
Debug view includes source and SQL INCLUDE statements.
*STMT
Debug view includes precompiler generated statements.
*LIST
Debug view includes the compiled listing.
*LSTDBG
Debug view includes the compiled listing of an OPM program.
ALLOW
Source debug allowed by the Unified Debugger.
DISALLOW
Source debug not allowed by the Unified Debugger.
DISABLE
Source debug not allowed by the Unified Debugger and the DEBUG MODE cannot be altered.

Start of changeContains null if the program is an external procedure without SQL statements.End of change

DBGKEY DBGKEY VARCHAR(3)
Start of changeNullableEnd of change
Specifies the type of source debug information:
NO
No encryption key was specified on the debug encryption key (DBGENCKEY) parameter.
YES
A key was specified on the debug encryption key (DBGENCKEY) parameter.

Start of changeContains null if DBGENCKEY is not supported or if the program is an external procedure without SQL statements.End of change

LAST_USED_TIMESTAMP LASTUSED TIMESTAMP
Nullable
The timestamp of the last time the program, service program, or module was used.

Start of changeContains null if the program, service program, or module has never been used.End of change

DAYS_USED_COUNT DAYSUSED INTEGER The number of days the program, service program, or module was used since the last time the usage statistics were reset. If the program, service program, or module has never been used since the last time the usage statistics were reset, contains 0.
LAST_RESET_TIMESTAMP LASTRESET TIMESTAMP
Nullable
The timestamp of the last time the usage statistics were reset.

Start of changeContains null if the statistics have never been reset.End of change

SYSTEM_PROGRAM_NAME SYS_NAME CHAR(10) System name of the program, service program, or module.
SYSTEM_PROGRAM_SCHEMA SYS_DNAME CHAR(10) System name of the schema containing the program, service program, or module.
Start of changeIASP_NUMBEREnd of change Start of changeIASPNUMBEREnd of change Start of changeINTEGEREnd of change Start of changeSpecifies the independent auxiliary storage pool (IASP) number.End of change