PROGRAM_INFO view
The PROGRAM_INFO view returns information about programs.
The values returned for the columns in the view are closely related to the values returned by the DSPPGM (Display Program) and DSPSRVPGM (Display Service Program) CL commands (the *BASIC, *SIZE, *SIGNATURE, and *COPYRIGHT details for ILE programs and service programs) and the Retrieve Program Information (QCLRPGMI) and Retrieve Service Program Information (QBNRSPGM) APIs.
- *EXECUTE authority to the library containing the program or service program, and
- *READ authority to the program or service program.
The following table describes the columns in the view. The first set of columns, through CONVERSION_DETAIL, apply to all ILE and OPM programs and service programs. The next group of columns apply to only ILE programs and service programs. The final group of columns apply to only OPM programs. The system name is PGM_INFO. The schema is QSYS2.
Column Name | System Column Name | Data Type | Description |
---|---|---|---|
PROGRAM_LIBRARY | PGM_LIB | VARCHAR(10) | The library containing the program or service program. |
PROGRAM_NAME | PGM_NAME | VARCHAR(10) | The program or service program. |
PROGRAM_TYPE | PGM_TYPE | VARCHAR(3) | The type of program or service program.
|
OBJECT_TYPE | OBJ_TYPE | VARCHAR(7) | Object type for PROGRAM_NAME.
|
CREATE_TIMESTAMP | CREATE_TS | TIMESTAMP(0) | The timestamp when the program or service program was created. |
TEXT_DESCRIPTION | TEXT | VARCHAR(50) Nullable
|
The user text, if any, used to briefly describe the program or
service program. Contains the null value if there is no text description. |
PROGRAM_OWNER | OWNER | VARCHAR(10) Nullable
|
The name of the program or service program owner's user
profile. Contains the null value if no program owner is available. |
PROGRAM_ATTRIBUTE | ATTRIBUTE | VARCHAR(10) Nullable
|
For an ILE program, the ILE language used for the module containing
the program entry procedure (PEP). For a service program, the language in which the modules of the service program are written. For an OPM program, the language the program is written in. Contains the null value is there is no attribute value or if a service program contains modules generated by different compilers. |
USER_PROFILE | USRPRF | VARCHAR(6) | The value specified for the USRPRF option on the command used to
create the program or service program.
|
USE_ADOPTED_AUTHORITY | USEADPAUT | VARCHAR(4) | The value specified for the USEADPAUT option on the command used to
change the program or service program.
|
PROGRAM_STATE | STATE | VARCHAR(8) | The state of the program or service program.
|
PROGRAM_DOMAIN | DOMAIN | VARCHAR(7) | The domain of the program or service program.
|
EARLIEST_POSSIBLE_RELEASE | EARLY_REL | CHAR(6) | The version, release, and modification level of the earliest release the program or service program is allowed to run on, in VvRrMm format. The target release (TGTRLS) parameter of the command can affect this value. |
RELEASE_CREATED_ON | CREATE_ON | CHAR(6) Nullable
|
The version, release, and modification level of the operating
system, in VvRrMm format, on which the program or service program was created. Contains the null value for OPM programs. |
TARGET_RELEASE | TGTRLS | CHAR(6) Nullable
|
This is the release specified on the target release (TGTRLS)
parameter of the command. Contains the null value for OPM programs. |
MINIMUM_NUMBER_PARMS | MIN_PARMS | INTEGER Nullable
|
The minimum number of parameters that is to be received by the
program when it is called. Contains the null value if this is a service program or if the information is not available. |
MAXIMUM_NUMBER_PARMS | MAX_PARMS | INTEGER Nullable
|
The maximum number of parameters that may be received by the
program when it is called. Contains the null value if this is a service program or if the information is not available. |
ASSOCIATED_SPACE_SIZE | ASSOC_SIZE | INTEGER | The size (in bytes) of the associated space used by this program or service program. |
PAGING_POOL | POOL | VARCHAR(8) | The paging pool used for the program or service program object.
|
PAGING_AMOUNT | PAGEAMOUNT | VARCHAR(8) | The paging behavior for the program or service program.
|
ALLOW_RTVCLSRC | ALWRTVSRC | VARCHAR(4) Nullable
|
Value of the ALWRTVSRC parameter if this program was created using
the Create CL Program (CRTCLPGM) command.
Contains the null value if this is not a CL program. |
CONVERSION_REQUIRED | CONVREQ | VARCHAR(4) | Indicates whether the program or service program has been converted
to the format required by the machine or if conversion is still required.
|
CONVERSION_DETAIL | CONVDETAIL | VARCHAR(8) | Indicates details about the conversion status.
|
The following columns apply to ILE programs and service programs. They will contain the null value for OPM programs. |
|||
PROGRAM_ENTRY_PROCEDURE_
MODULE_LIBRARY |
PEP_LIB | VARCHAR(10) Nullable
|
The library name that contained the module that contained the
program entry procedure for this program when the bind was done. Contains the null value if this is a service program. |
PROGRAM_ENTRY_PROCEDURE_MODULE | PEP_MODULE | VARCHAR(10) Nullable
|
The module name that contains the program entry procedure for this
program. Contains the null value if this is a service program. |
ACTIVATION_GROUP | ACTGRP | VARCHAR(10) Nullable
|
The name of the activation group in which this program or service
program runs. If the activation group already exists when the program or service program is called,
it runs in the existing activation group. If the activation group does not exist, a new activation
group is created and the program or service program runs in it. Can contain the following special values:
|
SHARED_ACTIVATION_GROUP | SHARED_AG | VARCHAR(4) Nullable
|
Whether the program or service program runs in a shared activation group.
|
OBSERVABLE_INFO_COMPRESSED | OBS_COMP | VARCHAR(4) Nullable
|
Whether the observable information associated with the program or
service program is compressed.
|
RUNTIME_INFO_COMPRESSED | RUN_COMP | VARCHAR(4) Nullable
|
Whether the run-time information associated with the program or
service program is compressed.
|
ALLOW_UPDATE | ALWUPD | VARCHAR(4) Nullable
|
Whether the Update Program (UPDPGM) or Update Service Program
(UPDSRVPGM) command is allowed on this program or service program.
|
ALLOW_BOUND_SRVPGM_LIBRARY_
UPDATE |
ALWLIBUPD | VARCHAR(4) Nullable
|
Whether the Update Program (UPDPGM) or Update Service Program
(UPDSRVPGM) command is allowed to change the bound *SRVPGM library names on this program or service program.
|
ALL_CREATION_DATA | ALL_CREATE | VARCHAR(6) Nullable
|
Whether the program or service program has all creation data and if
that data is observable or unobservable. All observable creation data is needed to re-create the
program or service program using the Change Program (CHGPGM) or Change Service Program (CHGSRVPGM)
command. All creation data (either observable or unobservable) is needed to convert the program or
service program during restore.
|
PROFILING_DATA | PRF_DATA | VARCHAR(10) Nullable
|
Specifies the profiling data attribute for this program or service program.
|
TERASPACE_STORAGE_ENABLED_
MODULES |
TERA_MOD | VARCHAR(5) Nullable
|
The teraspace storage capability of the modules bound to this
program or service program.
|
TERASPACE_STORAGE_ENABLED_PEP | TERA_PEP | VARCHAR(4) Nullable
|
Indicates whether the Program Entry Procedure (PEP) is teraspace
enabled.
Contains the null value if this is a service program. |
STORAGE_MODEL | STGMDL | VARCHAR(10) Nullable
|
Where the automatic and static storage for this program or service program is allocated at
run time.
|
ARGUMENT_OPTIMIZATION | ARGOPT | VARCHAR(4) Nullable
|
Whether argument optimization was done during program or service
program creation.
|
NUMBER_OF_UNRESOLVED_REFERENCES | UNRESOLVED | INTEGER Nullable
|
The number of symbols that could not be resolved at Create Program (CRTPGM) or Create Service Program (CRTSRVPGM) command time. |
ALLOW_STATIC_STORAGE_REINIT | ALWRINZ | VARCHAR(4) Nullable
|
Whether program or service program static storage can be reinitialized.
|
MINIMUM_STATIC_STORAGE_SIZE | MIN_STATIC | BIGINT Nullable
|
The minimum static storage size, in bytes, that this program or service program needs in order to run. |
MAXIMUM_STATIC_STORAGE_SIZE | MAX_STATIC | BIGINT Nullable
|
The maximum static storage size, in bytes, that this program or service program may need in order to run. |
AUXILIARY_STORAGE_SEGMENTS | NBR_AUX | INTEGER Nullable
|
The number of auxiliary storage segments in this program or service program. |
MAXIMUM_AUXILIARY_STORAGE_
SEGMENTS |
MAX_AUX | INTEGER Nullable
|
The maximum number of auxiliary storage segments an ILE program or service program can have. |
PROGRAM_SIZE | PGM_SIZE | INTEGER Nullable
|
The total size of the program or service program, in kilobytes. |
MAXIMUM_PROGRAM_SIZE | MAXPGMSIZE | INTEGER Nullable
|
The maximum size that an ILE program or service program can be, in kilobytes. |
MODULES | MODULES | INTEGER Nullable
|
The number of modules bound into this program or service program. |
MAXIMUM_MODULES | MAXMODS | INTEGER Nullable
|
The maximum number of modules that can be bound into an ILE program or service program. |
SERVICE_PROGRAMS | SRVPGMS | INTEGER Nullable
|
The number of service programs bound to this program or service program. |
MAXIMUM_SERVICE_PROGRAMS | MAXSRVPGMS | INTEGER Nullable
|
The maximum number of service programs that can be bound to an ILE program or service program. |
STRING_DIRECTORY_SIZE | STRDIRSIZE | INTEGER Nullable
|
The program or service program's string directory size. |
MAXIMUM_STRING_DIRECTORY_SIZE | MAXSTRDIR | INTEGER Nullable
|
The maximum size that the string directory can be in an ILE program or service program. |
COPYRIGHTS | COPYRIGHTS | INTEGER Nullable
|
The number of copyrights in this program or service program. |
COPYRIGHT_STRINGS | COPYR_JSON | CLOB(16M) CCSID 1208
Nullable
|
A list of copyrights. The value is returned as an array within a
JSON object. It is formatted as: {"COPYRIGHT":["first-string",
"second-string",...]} Contains the null value if COPYRIGHTS is 0.
|
COPYRIGHT_STRING_SIZE | CPYRSTRSIZ | INTEGER Nullable
|
The program or service program's copyright string size. |
MAXIMUM_COPYRIGHT_STRING_SIZE | MAXCPYRSTR | INTEGER Nullable
|
The maximum size of the copyright string in an ILE program or service program. |
EXPORT_SOURCE_LIBRARY | EXP_SRCLIB | VARCHAR(10) Nullable
|
The name of the library that contains the export source file. Can
contain the following special value:
Contains the null value if EXPORT_SOURCE_FILE is null. |
EXPORT_SOURCE_FILE | EXP_SRCF | VARCHAR(10) Nullable
|
The name of the export source file that contains the export source
file member. Contains the null value if this is not a service program, if there is no export source, if the export source was not specified using a source file, or if you are not authorized to this information. |
EXPORT_SOURCE_FILE_MEMBER | EXP_SRCM | VARCHAR(10) Nullable
|
The name of the member in the export source file that was used to
create this service program. Contains the null value if EXPORT_SOURCE_FILE is null. |
EXPORT_SOURCE_STREAM_FILE | EXP_STMF | VARGRAPHIC(5000) CCSID 1200 Nullable
|
The path name of the stream file that contains the export source
for this service program. Contains the null value if this is not a service program or if the export source was not specified using a stream file. |
PROCEDURE_EXPORTS | PROCEXP | INTEGER Nullable
|
The number of procedures exported from this service
program. Contains the null value if this is not a service program. |
MAXIMUM_PROCEDURE_EXPORTS | MAXPROCEXP | INTEGER Nullable
|
The maximum number of procedures that can be exported by a service
program. Contains the null value if this is not a service program. |
DATA_EXPORTS | DATAEXP | INTEGER Nullable
|
The number of data items exported from this service
program. Contains the null value if this is not a service program. |
MAXIMUM_DATA_EXPORTS | MAXDATAEXP | INTEGER Nullable
|
The maximum number of data items that can be exported by a service
program. Contains the null value if this is not a service program. |
SIGNATURES | SIGNATURES | INTEGER Nullable
|
The number of signatures for this service program. This is the
number of entries returned in EXPORT_SIGNATURES. Contains the null value if this is not a service program. |
EXPORT_SIGNATURES | EXP_SIG | BLOB(557038) Nullable
|
The list of export signatures for this service program. Each
signature is a binary string with a length of 16. A single hexadecimal 00 character separates
values. The current export signature of this service program is the first one in the list. Contains the null value if this is not a service program. |
MAXIMUM_SIGNATURES | MAXSIGS | INTEGER Nullable
|
The maximum number of signatures that can be in a service
program. Contains the null value if this is not a service program. |
The following columns apply to OPM programs. They will contain the null value for ILE programs and service programs. |
|||
SOURCE_FILE_LIBRARY | SRCLIB | VARCHAR(10) Nullable
|
The name of the library that contains the source file used to
create the program.. Contains the null value if no source file was used to create the program. |
SOURCE_FILE | SRCFILE | VARCHAR(10) Nullable
|
The name of the source file used to create the program. Contains the null value if no source file was used to create the program. |
SOURCE_FILE_MEMBER | SRCMBR | VARCHAR(10) Nullable
|
The name of the member in the source file. Contains the null value if no source file was used to create the program. |
SOURCE_FILE_CHANGE_
TIMESTAMP |
SRCF_CHGTS | TIMESTAMP(0) Nullable
|
The timestamp of when the member in the source file was last
updated. Contains the null value if no source file was used to create the program. |
SORT_SEQUENCE_LIBRARY | SRTSEQ_LIB | VARCHAR(10) Nullable
|
The name of the library that contained the sort sequence table used
when the module was compiled. This does not apply to SQL statements in the module. Can contain the
following special values:
Contains the null value if SORT_SEQUENCE contains a special value or is null. |
SORT_SEQUENCE | SRTSEQ | VARCHAR(10) Nullable
|
The name of the sort sequence table used when the program was
compiled. This does not apply to SQL statements in the program. Can contain the following special values:
Contains the null value if the program does not contain any sort sequence information. |
LANGUAGE_ID | LANGID | VARCHAR(7) Nullable
|
The language identifier used when the program was compiled. This
does not apply to SQL statements in the program. Can contain the following special value:
Contains the null value if the program does not contain any language identification information. |
OBSERVABLE | OBSERVABLE | VARCHAR(6) Nullable
|
Whether the OPM program contains creation data and if that data is
observable or unobservable. All observable creation data is needed to re-create the program using
CHGPGM. All creation data (either observable or unobservable) is needed to convert the program
during restore.
|
OPTIMIZATION | OPTIMIZE | VARCHAR(11) Nullable
|
Indicates what was specified on the OPTIMIZE parameter when the
program was created or changed.
|
LOG_COMMANDS | LOGCMD | VARCHAR(4) Nullable
|
The value specified for the LOG parameter of the CRTCLPGM command.
Contains the null value if the program is not a CL program. |
FIX_DECIMAL_DATA | FIXDECDATA | VARCHAR(4) Nullable
|
Whether decimal data that is not valid is corrected or an error is signaled.
|
UPDATE_PASA | UPDPASA | VARCHAR(10) Nullable
|
The compiler may have allowed you to control this attribute through
the GENOPT parameter of the command used to create the program.
|
CLEAR_PASA | CLRPASA | VARCHAR(10) Nullable
|
The compiler may have allowed you to control this attribute through
the GENOPT parameter of the command used to create the program.
|
COMPILER_ID | COMPILER | VARCHAR(14) Nullable
|
The licensed program identifier, version, release, and modification
level of the compiler. The value has a pppppppbVvRrMm format, where:
|
TERASPACE_STORAGE_ENABLED_PROGRAM | TS_PGM | VARCHAR(4) Nullable
|
The teraspace storage capability of the program. A program must be
teraspace storage enabled to access teraspace storage.
|
OPM_PROGRAM_SIZE | OPMPGMSIZE | INTEGER Nullable
|
The size (in bytes) of this program. |
STATIC_STORAGE_SIZE | STATIC_STG | INTEGER Nullable
|
The size (in bytes) of the static storage used by the program. |
AUTOMATIC_STORAGE_SIZE | AUTO_STG | INTEGER Nullable
|
The size (in bytes) of the automatic storage used by this program. |
NUMBER_MI_INSTRUCTIONS | MI_INSTR | INTEGER Nullable
|
The number of machine interface (MI) instructions used by this
program. Contains the null value if the program is not observable. |
NUMBER_MI_ODT_ENTRIES | MI_ODT | INTEGER Nullable
|
The number of ODT (object definition table) entries for the
program. There is a limit of 32767 ODT entries in a program. Contains the null value if the program is not observable. |
SQL_STATEMENT_COUNT | NBRSTMTS | INTEGER Nullable
|
The number of SQL statements contained in the program. Contains 0 if there are no SQL statements in the program. |
SQL_RELATIONAL_DATABASE | RDB | VARCHAR(18) Nullable
|
The default relational database that was specified on the SQL
precompile. Can contain the following special value:
Contains the null value if no package was created for the program by the SQL precompiler or if the program does not contain SQL statements. |
SQL_COMMITMENT_CONTROL | ISOLATION | VARCHAR(5) Nullable
|
The level of commitment control that was specified on the SQL precompile.
Contains the null value if the program does not contain SQL statements. |
SQL_NAMING | NAMING | VARCHAR(4) Nullable
|
The convention used for naming objects in SQL statements.
Contains the null value if the program does not contain SQL statements. |
SQL_DATE_FORMAT | DATFMT | VARCHAR(4) Nullable
|
The date format attribute.
Contains the null value if the program does not contain SQL statements. |
SQL_DATE_SEPARATOR | DATSEP | CHAR(1) Nullable
|
The date separator attribute. Contains the null value if the program does not contain SQL statements. |
SQL_TIME_FORMAT | TIMFMT | VARCHAR(4) Nullable
|
The time format attribute.
Contains the null value if the program does not contain SQL statements. |
SQL_TIME_SEPARATOR | TIMSEP | CHAR(1) Nullable
|
The time separator attribute. Contains the null value if the program does not contain SQL statements. |
SQL_SORT_SEQUENCE_LIBRARY | SQL_SSEQLB | VARCHAR(10) Nullable
|
The name of the library that is used to locate the SQL sort
sequence table. The following special values can be returned:
Contains the null value if SQL_SORT_SEQUENCE contains a special value or if the program does not contain SQL statements. |
SQL_SORT_SEQUENCE | SQL_SRTSEQ | VARCHAR(10) Nullable
|
The sort sequence table name specified when the program was
compiled. The following special values can be returned:
Contains the null value if the program does not contain SQL statements. |
SQL_LANGUAGE_ID | SQL_LANGID | VARCHAR(7) Nullable
|
The language identifier specified when the program was compiled.
The following special value can be returned:
Contains the null value if the program does not contain SQL statements. |
SQL_DEFAULT_SCHEMA | DFTRDBCOL | VARCHAR(10) Nullable
|
The schema name used for unqualified names of tables, views,
indexes, and SQL packages in static statements. Contains the null value if there is no default schema name or if the program does not contain SQL statements. |
SQL_PATH | SQLPATH | VARCHAR(3483) Nullable
|
The list of libraries used during resolution of functions,
procedures, and data types within SQL statements. The list is in the form of repeating library
names, each surrounded by double quotes and separated by commas. Contains the null value if the program does not contain SQL statements. |
SQL_DYNAMIC_USER_PROFILE | DYNUSRPRF | VARCHAR(10) Nullable
|
The user profile used for dynamic SQL statements. The following
special values can be returned:
Contains the null value if the program does not contain SQL statements. |
SQL_ALLOW_COPY_DATA | ALWCPYDTA | VARCHAR(9) Nullable
|
Whether a copy of the data can be used in the implementation of an
SQL query.
Contains the null value if the program does not contain SQL statements. |
SQL_CLOSE_SQL_CURSOR | CLOSQLCSR | VARCHAR(10) Nullable
|
Specifies the CLOSQLCSR attribute.
Contains the null value if the program does not contain SQL statements. |
SQL_DELAY_PREPARE | DLYPRP | VARCHAR(4) Nullable
|
Indicates the delay prepare attribute.
Contains the null value if the program does not contain SQL statements. |
SQL_ALLOW_BLOCK | ALWBLK | VARCHAR(8) Nullable
|
Whether blocking is used to improve the performance of certain SQL statements.
Contains the null value if the program does not contain SQL statements. |
SQL_PACKAGE_LIBRARY | SQLPKGLIB | VARCHAR(10) Nullable
|
The name of the library the SQL package is in. Contains the null value if the program is not distributed or if the program does not contain SQL statements. |
SQL_PACKAGE | SQLPKG | VARCHAR(10) Nullable
|
The name of the SQL package created on the relational database
specified on the RDB parameter of the command that created this program. Contains the null value if the program is not distributed or if it does not contain SQL statements. |
SQL_RDB_CONNECTION_METHOD | RDBCNNMTH | VARCHAR(4) Nullable
|
Specifies the semantics used for CONNECT statements:
Contains the null value if the program is not distributed or if it does not contain SQL statements. |
Examples
- Summarize the activation group usage for all ILE programs in
APPLIB.
SELECT ACTIVATION_GROUP, COUNT(*) AS ACTIVATION_GROUP_NAME_COUNT FROM QSYS2.PROGRAM_INFO WHERE PROGRAM_LIBRARY = 'APPLIB' AND PROGRAM_TYPE = 'ILE' GROUP BY ACTIVATION_GROUP ORDER BY 2 DESC;
- Examine the ownership of programs and service programs in
APPLIB.
SELECT PROGRAM_OWNER, OBJECT_TYPE, COUNT(*) AS APPLICATON_OWNER_COUNT FROM QSYS2.PROGRAM_INFO WHERE PROGRAM_LIBRARY = 'APPLIB' GROUP BY PROGRAM_OWNER, OBJECT_TYPE ORDER BY 2, 3 DESC;
- List all the copyrights for ILE programs in
APPLIB.
SELECT PROGRAM_LIBRARY, PROGRAM_NAME, PROGRAM_TYPE, COPYRIGHT FROM QSYS2.PROGRAM_INFO, JSON_TABLE(COPYRIGHT_STRINGS, 'lax $.COPYRIGHTS' COLUMNS (COPYRIGHT VARCHAR(500) PATH 'lax $[*]' )) WHERE PROGRAM_LIBRARY = 'APPLIB';