
PROGRAM_RESOLVED_IMPORTS table function
The PROGRAM_RESOLVED_IMPORTS table function returns the imports for an ILE program or service program that are resolved by exports from one or more service programs.
For each resolved import, the name of the symbol and the service program from which it is exported is returned. If the bound service program is qualified with *LIBL, the library list of the thread that invokes the function is used to find the service program.
No other system interface returns this information.
- *EXECUTE authority to the library containing the program or service program
- *READ authority to the program or service program
- *EXECUTE authority to the library containing the service program
- *READ authority to the service program
- program-library
- A character or graphic string expression that specifies the name of the library that contains program-name.
- program-name
- A character or graphic string expression that specifies the name of the program or service program to return resolved imports for.
- object-type
- A character or graphic string expression that specifies the type of object for
program-name.
- *PGM
- The object is a program.
- *SRVPGM
- The object is a service program.
- 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 one or more rows with the format shown in the following table.
Column Name | Data Type | Description |
---|---|---|
BOUND_SERVICE_PROGRAM_LIBRARY | VARCHAR(10) | The library that contains BOUND_SERVICE_PROGRAM. This can be the special value *LIBL. |
BOUND_SERVICE_PROGRAM | VARCHAR(10) | Service program that exports RESOLVED_SYMBOL_NAME. |
RESOLVED_SERVICE_PROGRAM_LIBRARY | VARCHAR(10) Nullable
|
If BOUND_SERVICE_PROGRAM_LIBRARY is *LIBL, the library list was
used to find the service program. The *SRVPGM is found based on the current library list when this
function is invoked, which could be a different object than the one found when program-name
was created or when the program is called. Otherwise, this value is the same as
BOUND_SERVICE_PROGRAM_LIBRARY. Contains the null value if BOUND_SERVICE_PROGRAM is not found when searching the library list. |
RESOLVED_SYMBOL_NAME | VARGRAPHIC(8192) CCSID(1200) Nullable
|
The name of the resolved symbol. Contains the null value if the
symbol is not available. Reasons include:
|
RESOLVED_SYMBOL_USAGE | VARCHAR(8) Nullable
|
The type for RESOLVED_SYMBOL_NAME.
Contains the null value if RESOLVED_SYMBOL_NAME is null. |
Note
This table function returns information for program and service program objects that were created on IBM i 6.1 or later. The RELEASE_CREATED_ON column of the QSYS2.PROGRAM_INFO view can be examined to determine if PROGRAM_RESOLVED_IMPORTS can be used for a program or service program.
Examples
Show the imports that are resolved via service programs for program QGPL/MATH.
SELECT *
FROM TABLE(QSYS2.PROGRAM_RESOLVED_IMPORTS(
PROGRAM_LIBRARY => 'QGPL',
PROGRAM_NAME => 'MATH',
OBJECT_TYPE => '*PGM'));
Show which programs and service programs in library QGPL use procedure Negate from service program QGPL/UNARY.
SELECT B.PROGRAM_LIBRARY, B.PROGRAM_NAME, B.OBJECT_TYPE
FROM QSYS2.BOUND_SRVPGM_INFO B,
TABLE(QSYS2.PROGRAM_RESOLVED_IMPORTS (
PROGRAM_LIBRARY => B.PROGRAM_LIBRARY,
PROGRAM_NAME => B.PROGRAM_NAME,
OBJECT_TYPE => B.OBJECT_TYPE)) R
WHERE B.PROGRAM_LIBRARY = 'QGPL' AND
B.BOUND_SERVICE_PROGRAM = 'UNARY' AND
(B.BOUND_SERVICE_PROGRAM_LIBRARY = 'QGPL' OR
(B.BOUND_SERVICE_PROGRAM_LIBRARY = '*LIBL' AND
R.RESOLVED_SERVICE_PROGRAM_LIBRARY = 'QGPL')) AND
R.RESOLVED_SYMBOL_NAME = 'Negate' AND
R.RESOLVED_SYMBOL_USAGE = '*PROCEXP'
ORDER BY 1, 2;
