Retrieve CL Source (RTVCLSRC)

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

The Retrieve CL Source (RTVCLSRC) command is used to retrieve the source statements from an OPM CL program that was used to compile that program. These source statements are placed into a source file member, which can be used as input when recompiling the CL program.

Top

Parameters

Keyword Description Choices Notes
PGM Program Qualified object name Required, Positional 1
Qualifier 1: Program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCFILE Source file Qualified object name Required, Positional 2
Qualifier 1: Source file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Source member Name, *PGM Optional, Positional 3
Top

Program (PGM)

Specifies the OPM CL program whose source is to be retrieved.

Note: RTVCLSRC cannot be used to retrieve the source for ILE CL programs and modules.

This is a required parameter.

Qualifier 1: Program

name
Specify the name of the program.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the program. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library where the program is located.
Top

Source file (SRCFILE)

Specifies the database source file into which the CL source statements are to be written. This file must exist when the command is run.

This is a required parameter.

Qualifier 1: Source file

name
Specify the name of the source file.

Qualifier 2: Library

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

Source member (SRCMBR)

Specifies the database source file member into which the CL source statements are to be written. If the name is not specified, the CL program name is used. If the member existed before the command was run, it is cleared before any source statements are written into it. If the member did not exist, it is created.

*PGM
The name of the CL program is used as the member name.
name
Specify the name of the source file member that will contain the CL source statements.
Top

Examples

RTVCLSRC   PGM(JOHN1/TEXT1)  SRCFILE(JOHN2)  SRCMBR(JOHN3)

This command retrieves the source statements from the CL program named TEXT1 in library JOHN1. The retrieved source statements are placed into the file named JOHN2, and are named as member JOHN3.

Top

Error messages

*ESCAPE Messages

CPF0560
Program &1 in &2 not a CL program.
CPF0561
Unable to retrieve CL source from CL program &2.
CPF0562
File &1 in &2 not a data base source file.
CPF0563
Record length too small for data base source file.
CPF0564
Unable to add data base member &3 to file.
CPF0565
Source from CL program &4 not retrieved.
CPF0566
Source not available for CL program &1 in &2.
CPF9801
Object &2 in library &3 not found.
CPF9803
Cannot allocate object &2 in library &3.
CPF9805
Object &2 in library &3 destroyed.
CPF9806
Cannot perform function for object &2 in library &3.
CPF9807
One or more libraries in library list deleted.
CPF9808
Cannot allocate one or more libraries on library list.
CPF9809
Library &1 cannot be accessed.
CPF9810
Library &1 not found.
CPF9811
Program &1 in library &2 not found.
CPF9820
Not authorized to use library &1.
CPF9821
Not authorized to program &1 in library &2.
CPF9822
Not authorized to file &1 in library &2.
CPF9830
Cannot assign library &1.
CPF9848
Cannot open file &1 in library &2 member &3.
CPF9849
Error while processing file &1 in library &2 member &3.
Top