Retrieve Service Program Information (QBNRSPGM) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Service Program Information (QBNRSPGM) API lets you retrieve service program 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 Service Program (DSPSRVPGM) command.

The QSYS2.PROGRAM_INFO view can be used as an alternative to this API. See PROGRAM_INFO view for more information.

You can use the QBNRSPGM API to retrieve the following:


Authorities and Locks

Library Authority
*EXECUTE
Service Program Authority (see note)
*READ
Service Program Lock
*SHRRD

Note:You must have *USE service program authority to retrieve the following fields in the SPGI0100 format:

If you attempt to retrieve these fields with *READ service program authority, they are set to blanks. All other fields in the SPGI0100 format require *READ service program authority.


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 service program.

The possible format names are:


Qualified service program name
INPUT; CHAR(20)

The first 10 characters contain the service program name. The second 10 characters contain the name of the library where the service program 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.


SPGI0100 Format

The following information is returned for the SPGI0100 format. See Authorities and Locks for the authority needed regarding specific fields. For detailed descriptions of the fields in the table, see Field Descriptions.



SPGI0200 Format

The following information is returned for the SPGI0200 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, refer to the online help for the Create Service Program (CRTSRVPGM) command.

Activation group attribute. The activation group attribute of this service program.

The possible values are:

All creation data. Whether the ILE service program has all creation data and if that data is observable or unobservable. All observable creation data is needed to re-create the service program using the Change Service Program (CHGSRVPGM) command. All creation data (either observable or unobservable) is needed to convert the service program during restore.

Possible values are:

Allow static storage reinitialization. Whether service program static storage can be reinitialized.

The possible values are:

Allow bound *SRVPGM library name update. Whether the Update Service Program (UPDSRVPGM) command is allowed to change the bound *SRVPGM library names on this service program.

Possible values are:

Allow update. Whether the Update Service Program (UPDSRVPGM) command is allowed on this service program.

Possible values are:

Associated space size. The size (in bytes) of the associated space used by this service program.

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.

Start of changeCCSID of the path name to the export source stream file. Coded character set ID of the path name to the export source stream file field. If the path name to the export source stream file field is not used, the value contained in this field is undefined. End of change

Conversion details. Indicates details about the service program's conversion status.

Possible values are:

Conversion required. Indicates whether the service program has been converted to the format required by the machine or if conversion is still required.

Possible values are:

Creation date and time. The date and time the service program was created. The creation date and time field is in the CYYMMDDHHMMSS format as follows:

Current copyright string size. The size of the service program's copyright string.

Current export signature. The current export signature of this service program.

Current number of auxiliary storage segments. The number of auxiliary storage segments in this service program.

Current number of modules. The number of modules bound into this service program.

Current number of program data exports. The number of data items exported from this service program.

Current number of program procedure exports. The number of procedures exported from this service program.

Current number of service programs. The number of service programs bound to this service program.

Current number of signatures. The number of signatures for this service program.

Current string directory size. The service program's string directory size.

Current total service program size. The total size of the service program, in kilobytes.

Earliest release service program can run. The version, release, and modification level of the earliest release on which the service program is allowed to run. The field has a VvRrMm format, where:

Export source file library name. The name of the library that contains the export source file. This may be blank if:

Export source file member name. The name of the member in the export source file that was used to create this service program. This may be blank if:

Export source file name. The name of the export source file that contains the export source file member.

Start of changeThe possible values are:

Start of changeLength of path name to the export source stream file. Specifies the number of bytes defined in the path name to the export source stream file field. If the export source file name field does not contain the special value of *STMF, then this field is set to zero. End of change

Maximum copyright string size. The maximum size of the copyright string in a service program.

Maximum number of auxiliary storage segments. The maximum number of auxiliary storage segments a service program can have.

Maximum number of modules. The maximum number of modules that can be bound into a service program.

Maximum number of program data exports. The maximum number of data items that can be exported by a service program.

Maximum number of program procedure exports. The maximum number of procedures that can be exported by a service program.

Maximum number of service programs. The maximum number of service programs that can be bound to a service program.

Maximum number of signatures. The maximum number of signatures that can be in a service program.

Maximum service program size. The maximum size of a service program, in kilobytes.

Maximum static storage size. The maximum amount of static storage in bytes that may be needed to run the service program. A value of 4294967295 will be given if 4 gigabytes (4294967296) or greater is needed. In this case, the maximum static storage size - long field should be used instead.

Maximum static storage size - long. The maximum amount of static storage in bytes that may be needed to run the service program.

Maximum string directory size. The maximum size of the string directory in a service program, in bytes.

Minimum static storage size. The minimum amount of static storage, in bytes, needed to run the service program. A value of 4294967295 will be given if 4 gigabytes (4294967296) or greater is needed. In this case, the minimum static storage size - long field should be used instead.

Minimum static storage size - long. The minimum amount of static storage in bytes needed to run the service program.

Number of copyrights. The number of copyrights in this service program.

Number of modules. The number of modules bound into this service program.

Number of service programs. The number of service programs bound to this program.

Number of unresolved references. The number of symbols that could not be resolved at Create Service Program (CRTSRVPGM) command time. This number could be zero if all references were resolved at the time the service program was created.

Observable information compressed. Whether the observable information associated with the service program is compressed.

The possible values are:

Paging amount. The compiler may have allowed you to control this attribute through the GENOPT parameter of the CRTSRVPGM command.

Possible values are:

*BLOCK gives better performance in most situations. It is likely that more than one page in the block is referred to before being replaced by other paging occurring in the storage pool.

*NOBLOCK can give better performance if the other pages that would have been brought in as a block are unlikely to be referred to before being replaced by other paging.

Paging pool. The paging pool used for the service program object. The compiler may have allowed you to control this attribute through the GENOPT parameter of the CRTSRVPGM command.

The values returned are:

*USER is used by most system service programs and all user service programs unless GENOPT(*MACHINE) is specified.

*MACHINE is used by a few system service programs that are so highly used that their pages should remain almost constantly in main storage. The machine pool is intended to be a stable, low paging pool. If user service programs page in the machine pool, there may be contention for main storage between system and user service programs. This may adversely affect system performance and response times. To prevent paging contention, increase the QMCHPOOL system value with the Change System Value (CHGSYSVAL) command.

Start of changePath name to the export source stream file. The path name of the stream file that contains the export source for this service program. The length of the path name to the export source stream file field contains the number of bytes that make up the path name in this field. The remaining bytes in the field are undefined. The CCSID of the path name in this field is contained in the CCSID of the path name to the export source stream file field. This field contains a path name only if the export source file name field contains a special value of *STMF. Otherwise, the value contained in this field is undefined. End of change

Profiling data. The profiling data attribute for this service program.

Possible values are:

Release service program created for. This is the release specified on the target release (TGTRLS) parameter of the Create Service Program (CRTSRVPGM) command. The value specified for the TGTRLS parameter can affect the earliest release value on which the program can run.

Release service program created on. The version, release, and modification level of the operating system on which the service program was created. The field has a VvRrMm format, where:

Reserved. An ignored field.

Run-time information compressed. Whether the run-time information associated with the service program is compressed.

Possible values are:

Service program attribute. The language the program is written in (for example, RPG.)

Service program CCSID. The coded character set identifier (CCSID) for this service program. This is 65535 for service programs.

Service program domain. The domain of the service program.

Possible values are:

Service program library name. The name of the library containing the service program.

Service program name. The name of the service program.

Service program owner. The name of the service program owner's user profile.

Service program size. The size (in bytes) of this service program.

Service program state. The state of the service program.

Possible values are:

Shared activation group. Whether the service program runs in a shared activation group.

Static storage size. The maximum amount of static storage in bytes that may be needed to run the service program. A value of 4294967295 will be given if 4 gigabytes (4294967296) or greater is needed. In this case, the maximum static storage size - long field should be used. The maximum static storage size - long field is available from the SPGI0200 format.

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

The following values can be returned:

Teraspace storage enabled modules. The teraspace storage capability of the modules bound to this service program.

Possible values are:

Text description. The user text, if any, used to briefly describe the service program and its function.

Use adopted authority. The value specified for the USEADPAUT option on the command used to change the service program.

Possible values are:

User profile. The value specified for the USRPRF option on the CRTSRVPGM command.

Possible values are:

Uses argument optimization (ARGOPT). Whether argument optimization was done during service program creation.

Possible values are:



Error Messages



API introduced: V2R3

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