Retrieve Binder Source (RTVBNDSRC)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Retrieve Binder Source (RTVBNDSRC) command can be used to retrieve the exports from a set of modules, a service program, or both, and place them (along with the binder language statements needed for the exports) in a specified file member. This file member can later be used as input to the Create Service Program (CRTSRVPGM) command SRCMBR parameter. After the binder language has been retrieved into a source file member, you can edit the binder language to make changes as needed.

By default, the CRTSRVPGM command has a binder language file specified on the EXPORT and SRCFILE parameters to identify the exports from the service program. The RTVBNDSRC command can be useful in helping you automatically create this binder language.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
MODULE Module Values (up to 300 repetitions): Qualified object name Optional, Positional 1
Qualifier 1: Module Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL
SRVPGM Service program Qualified object name Optional
Qualifier 1: Service program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCFILE Export source file Qualified object name Optional
Qualifier 1: Export source file Name, QSRVSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Export source member Name, *DFT Optional
MBROPT Replace or add records *ADD, *REPLACE Optional
Top

Module (MODULE)

Specifies the list of modules from which to retrieve the exported symbols. If duplicate module and library specifications are found, only the first instance of the duplicate module and library is used.

At least one value must be specified for this parameter or the Service program (SRVPGM) parameter.

You can specify up to 300 values for this parameter.

Qualifier 1: Module

*ALL
The exported symbols from all of the modules in the specified library are retrieved.
generic-name
Specify a generic module name from which to retrieve the exported symbols. All modules that have names with the same prefix in the specified library or libraries are used. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name.
name
Specify the name of the module from which to retrieve the exported symbols.

Qualifier 2: Library

*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
*USRLIBL
Only the libraries in the user portion of the job's library list are searched.
name
Specify the name of the library to be searched.
Top

Service program (SRVPGM)

Specifies the service program from which to retrieve the exported symbols. At least one value must be specified for this parameter or the Module (MODULE) parameter.

Qualifier 1: Service program

name
Specify the name of the service program from which to retrieve the exported symbols.

Qualifier 2: Library

*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

Export source file (SRCFILE)

Specifies the source file that is to hold the binder language for the exported symbols. If the source file does not exist, it is created.

Notes:

Qualifier 1: Export source file

QSRVSRC
The source file name is QSRVSRC.
name
Specify the name of the source file.

Qualifier 2: Library

*LIBL
All libraries in the job's library list are searched until the first match is found. If a source file by the name specified is not found in the library list, it is created in the current library. If there is no current library, the QGPL library is used.
*CURLIB
The current library for the job is searched. If a source file by the name specified does not exist, it is created in the current library. If there is no current library, the QGPL library is used.
name
Specify the name of the library to be searched. If a source file by the name specified is not found in this library, the source file is created in this library.
Top

Export source member (SRCMBR)

Specifies the member in the source file that is to hold the binder language for the exported symbols. Only one source member will contain the binder language.

If the member does not exist in the source file specified, the member is created.

*DFT
The name of the source file member is taken from the value specified for the Service program (SRVPGM) parameter, if a service program is specified. Otherwise, the name of the source file member is taken from the value specified for the :Module (MODULE) parameter,
  • If only one module is specified, the name of that module is the member name used.
  • If more than one module is specified, the name of the first module specified is used.
  • If the value *ALL or a generic name is specified, the module name of the first occurrence found is the source member name used.
name
Specify the name of the member that will contain the generated source binder language.
Top

Replace or add records (MBROPT)

Specifies whether the generated binder language statements are replaced or added to the existing statements.

*REPLACE
The system clears the existing member and adds the new records.
*ADD
The system adds the new records to the end of the existing records.

Note: If the member already exists and, for example, already contains STRPGMEXP and ENDPGMEXP statements, the member may contain multiple STRPGMEXP and ENDPGMEXP statements in the binder language at the end of this operation. You must edit these multiple statements in order to use the binder language with the Create Service Program (CRTSRVPGM) command.

Top

Examples

RTVBNDSRC   MODULE(MYLIB/*ALL)
            SRCFILE(MYLIB/MYBINDFILE)  MBROPT(*ADD)

This command retrieves the exports from all modules in the library MYLIB, and places them in the source member with the name of the first module found. If this source member does not exist in the file MYBINDFILE in the library MYLIB, it is created. The export statements are added to the end of the member. If multiple start and end program export statements exist in the file when this command is ended, the source member must be edited before it is used to create a service program. Either the extra STRPGMEXP, ENDPGMEXP statements can be removed, or the PGMLVL parameter can be added to the STRPGMEXP statements, if some of the export blocks are for previous versions of the service program.

Top

Error messages

*ESCAPE Messages

CPF5CA5
Record length too small for data base source file.
CPF5D06
Not authorized to library &2, or file &1 in library &2, or member &3.
CPF5D08
File &1 in library &2 not supported file type.
CPF9801
Object &2 in library &3 not found.
CPF9802
Not authorized to object &2 in &3.
CPF9803
Cannot allocate object &2 in library &3.
CPF9810
Library &1 not found.
CPF9820
Not authorized to use library &1.
CPF9832
Function not supported for DDM file &2.
CPF9834
Input file &1 in library &2 is not a source file.
CPF9848
Cannot open file &1 in library &2 member &3.
CPF9899
Error occurred during processing of command.
Top