Retrieve Binder Source (RTVBNDSRC)
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:
- You must have use (*USE) authority to the Create Source Physical File (CRTSRCPF) command, if the file does not exist.
- You must have *USE authority to the Reorganize Physical File Member (RGZPFM) command.
- You must have *USE authority to the Add Physical File Member (ADDPFM) command, if the member does not exist.
- You must have *USE authority to the modules or service program from which the exports are being retrieved.
- You must have execute (*EXECUTE) authority to the libraries in which the modules or service program exist.
- If the source file and member to receive the binder language exist, you must have change (*CHANGE) authority and either object alter (*OBJALTER) or object management (*OBJMGT) authority to the file, and *EXECUTE authority to the library that contains the file.
- If the source file exists but the source member needs to be created, you must have *CHANGE authority and either *OBJALTER or *OBJMGT authority to the file, and *EXECUTE, read (*READ) and add (*ADD) authorities to the library that contains the file.
- If the source file and member need to be created, you must have *EXECUTE, *READ and *ADD authorities to the library.
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 |
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.
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.
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:
- Only a database physical file of type *SRC can be specified. Distributed data management (DDM) files are not supported.
- If the source file to receive the binder language exists, its record length must be a minimum of 92 bytes.
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.
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.
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.
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.
*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.