RTVCLSRC (Retrieve CL Source)

RTVCLSRC Command syntax diagram

 

Purpose

The Retrieve CL Source (RTVCLSRC) command is used to retrieve the source statements from a CL program 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.

 

Required Parameters

PGM
Specifies the qualified name of the CL program whose source statements are being retrieved.

The name of the program can be qualified by one of the following library values:

*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.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the CL program whose source statements are being retrieved.

SRCFILE
Specifies the qualified name of the previously created database source file into which the CL source statements are being written.

The name of the source file can be qualified by one of the following library values:

*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.

library-name: Specify the name of the library to be searched.

source-file-name: Specify the name of the database source file that contains the CL source statements.

 

Optional Parameters

SRCMBR
Specifies the name of the database source file member into which the CL source statements are being written. If not specified, the CL program name is assumed. If the member existed before running the command, 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.

source-member-name: Specify the name of the source file member that contains the CL source statements.

Example for RTVCLSRC

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.

Error messages for RTVCLSRC

*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.