Retrieve Module Information (QBNRMODI) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Module Information (QBNRMODI) API lets you retrieve module information and place it into a single variable in the calling program. The amount of information returned is limited to the size of the variable. This information is similar to the information returned using the Display Module (DSPMOD) command.

You can use the QBNRMODI API to retrieve the following:


Authorities and Locks

Library Authority
*EXECUTE
Module Authority
*USE
Module Lock
*SHRRD

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is to receive the information requested. The minimum size for this area is 8 bytes. You can specify the size of this area to be smaller than the format requested if you specify the length of receiver variable parameter correctly. As a result, the API returns only the data that the area can hold.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable. If this value is larger than the actual size of the receiver variable, the results may not be predictable. The minimum value is 8.

Format name
INPUT; CHAR(8)

The content and format of the information returned for the module.

The possible format names are:


Qualified module name
INPUT; CHAR(20)

The first 10 characters contain the module name. The second 10 characters contain the name of the library where the module is located.

You can use these special values for the library name:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


MODI0100 Format

The following information is returned for the MODI0100 format. For detailed descriptions of the fields in the table, see Field Descriptions.



MODI0200 Format

The following information is returned for the MODI0200 format. For detailed descriptions of the fields in the table, see Field Descriptions.



Field Descriptions

For more detailed information than that provided in the following field descriptions, see the Control language topic collection for the Create XXX Module (CRTxxxMOD) commands.

Allow blocking. Indicates whether blocking is used to improve the performance of certain SQL statements.

Possible values are:

Allow copy of data. Indicates whether a copy of the data can be used in the implementation of an SQL query.

Possible values are:

Allow RTVCLSRC. Whether the module has CL source data that can be retrieved from the program. The possible values are:

Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned.

Close SQL cursor. Specifies when SQL cursors are implicitly closed and SQL prepared statements are implicitly discarded.

Possible values are:

Commitment control. The level of commitment control that was specified on the SQL precompile.

Possible values are:

Connection method. Indicates whether connections are allowed to one or more relational databases.

The following special values can be returned:

Conversion details. Indicates details about the module's conversion status.

Possible values are:

Conversion required. Indicator as to whether the module has been converted to the format required by the machine or if conversion is still required.

Creation data. Whether the module has all creation data and if that data is observable or unobservable. All observable creation data is needed to re-create the module using the Change Module (CHGMOD) command. All creation data (either observable or unobservable) is needed to convert the module during restore.

Current alias component size. The size, in bytes, of the alias component. The size is the decompressed size, even if the module is compressed. The current size increases as more data objects, particularly arrays and structures, are added to the module.

Current associated space size. The size, in bytes, of the associated space. The number of SQL statements in the module may affect the current size.

Current automatic storage allocation size. The size, in bytes, of the largest automatic storage allocation associated with the procedure referenced by the offset to the largest automatic storage allocation procedure name for this module. The current size increases as more automatic variables and bound procedure calls are added.

Current binding specifications component size. The size, in bytes, of the binding specifications component. The size is the decompressed size, even if the module is compressed. The current size increases as imported and exported procedures and data items are added.

Current binding work area size. The size, in bytes, of the binding work area. The size is the decompressed size, even if the module is compressed. The current size increases as imports and exports are added to the module.

Current debug space size. The size, in bytes, of the debug space. The size is the decompressed size, even if the module is compressed. See the debug view (DBGVIEW) parameter of the Create xxx Module (CRTxxxMOD) command for more information on the different debug view levels you can specify at create time. You can completely remove the debug view data from the module by using the remove observability (RMVOBS) parameter of the Change Module (CHGMOD) command.

Current debug statement mapping table size. The size, in bytes, of the debug statement mapping table associated with the procedure referenced by the offset to the largest debug statement mapping table procedure name for this module. The current size increases as statements are added or increase in complexity.

Current dictionary component size. The size, in bytes, of the dictionary component. The size is the decompressed size, even if the module is compressed. The current size increases as more data objects, exception handlers, constants, and procedures are added.

Current dictionary mapping table size. The amount of space, in bytes, for the dictionary mapping table. The size is the decompressed size, even if the module is compressed. The dictionary mapping table does not exist if the DBGVIEW(*NONE) option is used when the module is created. If it does exist, its current size depends on the number of different variables that are declared in the module.

Current exception mapping table list area size. The amount of space, in bytes, for the exception mapping table list area. The size is the decompressed size, even if the module is compressed. The current size depends on the number of exception handlers that are enabled in the code. The handlers could be either defined by the user or defined by the compiler to handle exceptions in the generated code.

Current exception mapping table size. The amount of space, in bytes, for the exception mapping table. The size is the decompressed size, even if the module is compressed. The current size depends on the number of exception handlers that are either declared by the user or defined by the compiler to handle exceptions in the generated code.

Current exception statement mapping table size. The size, in bytes, of the exception statement mapping table associated with the procedure referenced by the offset to the largest exception statement mapping table procedure name for this module. This table is used to map high-level language statements to Licensed Internal Code instructions. The current size increases as statements are added or increase in complexity.

Current initialization component size. The size, in bytes, of the initialization component. The size is the decompressed size, even if the module is compressed. The current size increases as more statements to statically initialize data objects are added.

Current instructions component size. The size, in bytes, of the instructions component. The size is the decompressed size, even if the module is compressed.

Current largest procedure size. The size, in bytes, of the largest procedure in the module.

Current Licensed Internal Code stack allocation size. The size, in bytes, of the Licensed Internal Code stack allocation associated with the procedure referenced by the offset to the largest Licensed Internal Code stack allocation procedure name for this module. The current size increases at higher levels of optimization.

Current literal pool component size. The size, in bytes, of the literal pool component. The size is the decompressed size, even if the module is compressed. The current size increases as more literals or initializations are added to the module.

Current machine instruction range mapping size. The size, in bytes, of the machine instruction range mapping associated with the procedure referenced by the offset to the largest machine instruction range mapping procedure name for this module. The number of times exception handlers are enabled and disabled affects the current size. Also, some instructions, like packed decimal arithmetic, affect this size.

Current module constants size. The amount of space, in bytes, for module constants. The size is the decompressed size, even if the module is compressed. Changing the number of large aggregate constants or the number of smaller constants may affect the current size.

Current number auxiliary storage segments. The number of auxiliary storage segments used by this module.

Current number of copyrights. The number of copyrights defined in this module.

Current number of procedures. The number of procedures declared in this module.

Current number of static storage allocations. The number of static storage allocations used by this module. The current number increases as static data items (particularly imported data items) are added to the module.

Current procedures and constants size. The current amount of space, in kilobytes, for procedures and constants. The size is the decompressed size, even if the module is compressed. The current size increases as more instructions are added. The number of literals and the size of the literal values may have an effect on the current size. This number could be zero in which case it means the size is less than 1 kilobyte.

Current static storage size. The amount of static storage, in bytes, required for the module. The size is the decompressed size, even if the module is compressed. As more and larger static and exported variables are declared, the current size increases. A value of 4294967295 will be given if 4 gigabytes (4294967296) or greater is needed. In this case, the current static storage size - long field should be used instead.

Current static storage size - long. The current amount of static storage, in bytes, required for the module.

Current static storage work area size. The size, in bytes, of the static storage work area. The size is the decompressed size, even if the module is compressed. The current size increases as static data items or initializations are added to the module.

Current string directory component size. The size, in bytes, of the string directory component. The size is the decompressed size, even if the module is compressed. The current size increases as imported and exported procedures and data items are added.

Current total module size. The size of the module, in kilobytes. The size is the decompressed size, even if the module is compressed.

Current type information component size. The size, in bytes, of the type information component. The size is the decompressed size, even if the module is compressed. The current size increases as more procedures are added to the module.

Date format. Specifies the format used when accessing date result columns through SQL. All output date fields are returned in this format. For input date strings, the value you specify is used to determine whether the date is a valid format.

Possible values are:

Date separator. Specifies the separator used when accessing date result columns. A blank value indicates either that there are no SQL statements or that the separator character is a blank. Assume the latter if the number of SQL statements parameter is not zero.

Debug data. Indicates whether debug data exists for this module. If debug data exists, the module may be debugged using the source debugger.

Default collection name. Specifies the collection name used for the unqualified names of tables, views, indexes, and SQL packages. *NONE indicates there is no default collection.

Delay PREPARE. Indicates whether SQL prepare processing can be delayed until the statement is actually used.

Possible values are:

Dynamic user profile. Specifies the user profile used for dynamic SQL statements.

The following special values can be returned:

Earliest release module can be restored to. The earliest version, release, and modification level of the operating system to which the module may be restored.

The field has a VvRrMm format, where:

Enable performance collection. The level of performance collection enabled for this module.

The following values can be returned:

Intermediate language (IL) data. Whether the module has intermediate language (IL) data.

Language identifier. The language identifier used when the module was compiled. A

possible special value is:

Largest automatic storage allocation procedure name. The name of the largest automatic storage allocation procedure in the module.

Largest debug statement mapping table procedure name. The name of the largest debug statement mapping table procedure in the module.

Largest exception statement mapping table procedure name. The name of the largest exception statement mapping table procedure in the module.

Largest Licensed Internal Code stack allocation procedure name. The name of the largest Licensed Internal Code stack allocation procedure in the module.

Largest machine instruction range mapping procedure name. The name of the largest machine instruction range mapping procedure in the module.

Largest procedure name. The name of the largest procedure in the module.

Length of largest automatic storage allocation procedure name. The size, in bytes, of the name of the largest automatic storage allocation procedure in this module.

Length of largest debug statement mapping table procedure name. The size, in bytes, of the name of the largest debug statement mapping table procedure.

Length of largest exception statement mapping table procedure name. The size, in bytes, of the name of the largest exception statement mapping table procedure.

Length of largest Licensed Internal Code stack allocation procedure name. The size, in bytes, of the name of the largest Licensed Internal Code stack allocation procedure.

Length of largest machine instruction range mapping procedure name. The size, in bytes, of the name of the largest machine instruction range mapping procedure.

Length of largest procedure name. The size, in bytes, of the name of the largest procedure.

Length of Licensed Internal Code options. The size, in two-byte characters, of the Licensed Internal Code options string. This is 0 if no Licensed Internal Code options were used for this module.

Length of program entry procedure name. The size, in bytes, of the program entry procedure name.

Licensed Internal Code options. The Licensed Internal Code options being used by the module. This field is specified in UCS-2 (CCSID 13488).

Maximum alias component size. The maximum possible size, in bytes, of the alias component.

Maximum associated space size. The maximum possible size, in bytes, of the associated space.

Maximum automatic storage allocation size. The maximum possible size, in bytes, of the largest automatic storage allocation associated with a procedure for a module.

Maximum binding specifications component size. The maximum possible size, in bytes, of the binding specifications component.

Maximum binding work area size. The maximum possible size, in bytes, of the binding work area.

Maximum debug space size. The maximum possible size, in bytes, of the debug space.

Maximum debug statement mapping table size. The maximum possible size, in bytes, of the debug statement mapping table associated with a procedure for a module.

Maximum dictionary component size. The maximum possible size, in bytes, of the dictionary component.

Maximum dictionary mapping table size. The maximum possible amount of space, in bytes, for the dictionary mapping table.

Maximum exception mapping table list area size. The maximum possible amount of space, in bytes, for the exception mapping table list area.

Maximum exception mapping table size. The maximum possible amount of space, in bytes, for the exception mapping table.

Maximum exception statement mapping table size. The maximum possible size, in bytes, of the exception statement mapping table associated with a procedure for a module.

Maximum initialization component size. The maximum possible size, in bytes, of the initialization component.

Maximum instructions component size. The maximum possible size, in bytes, of the instructions component.

Maximum largest procedure size. The maximum possible size, in bytes, of a procedure in a module.

Maximum Licensed Internal Code stack allocation size. The maximum possible size, in bytes, of the Licensed Internal Code stack allocation associated with a procedure for a module.

Maximum literal pool component size. The maximum possible size, in bytes, of the literal pool component.

Maximum machine instruction range mapping size. The maximum possible size, in bytes, of the machine instruction range mapping associated with a procedure for a module.

Maximum module constants size. The maximum possible amount of space, in bytes, for module constants.

Maximum module size. The largest size, in kilobytes, allowed for a module.

Maximum number auxiliary storage segments. The maximum possible number of auxiliary storage segments used by a module.

Maximum number of copyrights. The maximum possible number of copyrights defined in a module.

Maximum number of parameters. The maximum number of parameters that are to be received by the program entry procedure if one is present in the module.

Maximum number of procedures. The maximum possible number of procedures declared in a module.

Maximum number of static storage allocations. The maximum possible number of static storage allocations used by a module.

Maximum optimization level. The highest level of optimization you may request. If observability has been removed from the module, this maximum optimization level value might not be the same as the one specified when the module was created.

The following values can be returned:

Maximum procedures and constants size. The maximum possible amount of space, in kilobytes, for procedures and constants. This number could be zero, in which case it means the size is less than 1 kilobyte.

Maximum static storage size. The maximum possible amount of static storage, in kilobytes, required for a module.

Maximum static storage size - long. The maximum possible amount of static storage, in bytes, required for a module.

Maximum static storage work area size. The maximum possible size, in bytes, of the static storage work area.

Maximum string directory component size. The maximum possible size, in bytes, of the string directory component.

Maximum type information component size. The maximum possible size, in bytes, of the type information component.

Minimum number of parameters. The minimum number of parameters that are to be received by the program entry procedure if one is present in the module.

Module attribute. The programming language in which the module is written or the product that produced the module.

Module CCSID (Coded Character Set ID). The coded character set identifier (CCSID) for this module.

Module compressed status. Indicates whether the module is in compressed format.

The following values can be returned:

Module creation date and time. The date and time when the module was created. The creation date and time field is in the CYYMMDDHHMMSS format as follows:

Module domain. The domain of the module.

The possible value is:

Module library name. The library that contains the module.

Module name. The name of the module whose information is being given.

Module owner. The name of the user profile of the user who owns this module.

Module state. The state of the module.

The Possible values are:

Naming convention. The naming convention used for naming objects in SQL statements.

Possible values are:

Number of exported defined symbols. The number of exported procedures and variables in this module.

Number of imported (unresolved) symbols. The number of imported procedures and variables in this module.

Number of SQL statements. The number of DB2 for IBM i SQL statements contained in the module.

Offset to largest automatic storage allocation procedure name. The offset from the beginning of the receiver variable where the largest automatic storage allocation procedure begins.

Offset to largest debug statement mapping table procedure name. The offset from the beginning of the receiver variable where the largest debug statement mapping table procedure name begins.

Offset to largest exception statement mapping table procedure name. The offset from the beginning of the receiver variable where the largest exception statement mapping table procedure name begins.

Offset to largest Licensed Internal Code stack allocation procedure name. The offset from the beginning of the receiver variable where the largest Licensed Internal Code stack allocation procedure name begins.

Offset to largest machine instruction range mapping procedure name. The offset from the beginning of the receiver variable where the largest machine instruction range mapping procedure name begins.

Offset to largest procedure name. The offset from the beginning of the receiver variable where the largest procedure name begins.

Offset to Licensed Internal Code options. The offset from the beginning of the receiver variable where the Licensed Internal Code options begin.

Offset to program entry procedure name. The offset from the beginning of the receiver variable where the program entry procedure name begins.

Optimization level. Optimization levels cause the translator to produce machine code that reduces the amount of system resources necessary to run the program. The more optimization, the more efficiently the module runs on the system. Also, with more optimization you may not be able to change or view variables that have been optimized.

The Possible values are:

Profile data. The profile data attribute for the module.

Program entry procedure name. The name of the program entry procedure if one is present in the module.

Program entry procedure name indicator. Indicates if a program entry procedure is present in the module.

Relational database. The default relational database that was specified on the SQL precompile.

Possible values are:

Release module created for. The version, release, and modification level of the operating system for which the module was created.

The field has a VvRrMm format, where:

Release module created on. The version, release, and modification level of the operating system that was running on the system when the module was created. The field has a VvRrMm format, where:

Reserved. An ignored field.

Sort sequence table library name. The name of the library that is used to locate the sort sequence table.

Possible special values are:

Sort sequence table name. The name of the sort sequence table used when the module was compiled.

Possible special values are:

Source file change date and time. The date and time when the source member that was used to create this module was last changed. The source file change date and time field is in the CYYMMDDHHMMSS format as follows:

Source file library name. The library that contained the source file that was used to create this module.

Source file name. The source file that contained the source member that was used to create this module. If this field is blank, the module was created from an inline source file

Source member name. The source file member from which this module was created.

SQL language identifier. Returns the language identifier used when the module was compiled. This information is blank if the module does not contain any language identification information.

The special value that can be returned is:

SQL package library name. Specifies the name of the library containing the SQL package. A blank indicates the module is not to be distributed.

The following possible special values can be returned:

SQL package name. Specifies the name of the SQL package created on the relational database specified on the RDB parameter of the command that created this module. *NONE indicates that this is not a distributed module.

SQL path. The list of libraries used during resolution of functions 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.

SQL path length. The length, in bytes, of the SQL path.

SQL path offset. The offset, in bytes, from the beginning of this format definition to the beginning of the SQL path.

SQL sort sequence table library name. Returns the name of the library that is used to locate the SQL sort sequence table. This information is blank either if the module does not contain any SQL sort sequence information, or if a special value was returned for the SQL sort sequence table name.

The following possible special values that can be returned for the library are:

SQL sort sequence table name. Returns the SQL statement sort sequence table name used when the module was created. This information is blank if the module does not contain any SQL sort sequence information.

The following possible special values can also be returned:

Storage model. Where the automatic and static storage for this bound module is allocated at run time.

The following values can be returned:

Teraspace storage enabled. The teraspace storage capability for this module.

Possible values are:

Text description. The text description that was provided for this module.

Time format. Specifies the format used when accessing time -result columns through SQL. All output time fields are returned in this format. For input time strings, the value you specify is used to determine whether the time is a valid format.

Possible values are:

Time separator. Specifies the separator used when accessing time result columns. A blank value indicates that there are no SQL statements or that the separator character is a blank. Assume the latter if the number of SQL statements parameter is not zero.


Error Messages


API introduced: V3R6

[ Back to top | Program and CL Command APIs | APIs by category ]