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 original program model (OPM) CL program or an integrated language environment (ILE) CL module. In the case of an ILE CL module, RTVCLSRC can also retrieve the CL source from an ILE program (*PGM) or service program (*SRVPGM) object which contains the specified CL module.
In order to retrieve the CL source, *YES must have been specified for the Allow RTVCLSRC (ALWRTVSRC) parameter when the CL source was compiled.
The CL source statements are placed into a source file member, which can be used as input to recompile the CL source.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
PGM | Program | Qualified object name | Optional, Positional 1 |
Qualifier 1: Program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SRVPGM | Service program | Qualified object name | Optional |
Qualifier 1: Service program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MODULE | Module | Single values: *PGM Other values: Qualified object name |
Optional |
Qualifier 1: Module | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SRCFILE | Source file | Qualified object name | Optional, Positional 2 |
Qualifier 1: Source file | Name, QCLSRC | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SRCMBR | Source member | Name, *PGM | Optional, Positional 3 |
RTVINCSRC | Retrieve included source | *NO, *YES | Optional |
Top |
Specifies the program object from which the original CL source is to be retrieved.
Note: This parameter and the Service program (SRVPGM) parameter are mutually exclusive.
Qualifier 1: Program
Qualifier 2: Library
Top |
Specifies the service program object from which the original CL source is to be retrieved.
Note: This parameter and the Program (PGM) parameter are mutually exclusive.
Qualifier 1: Program
Qualifier 2: Library
Top |
Specifies the CL module from which the original CL source is to be retrieved. If a value is specified for either the Program (PGM) parameter or the Service program (SRVPGM) parameter, this parameter identifies which CL module in the program or service program contains the CL source to be retrieved.
Note: This parameter is ignored if an original program model (OPM) program object is specified for the Program (PGM) parameter.
Single values
Qualifier 1: Module
Qualifier 2: Library
Top |
Specifies the database source file into which the CL source statements are to be written. This file must exist when the command is run.
Qualifier 1: Source file
Qualifier 2: Library
Top |
Specifies the database source file member into which the CL source statements are to be written. 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.
Top |
Specifies whether or not to retrieve CL commands that were included by INCLUDE (Include CL Source) commands in the original source CL program.
Specifying *NO for this parameter will produce CL source which most closely matches the original CL source.
Specifying *YES for this parameter will produce CL source which most closely matches the full CL source used to create the CL program or module.
Top |
Example 1: Retrieving the Original CL Source
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. If the original CL source program contained any INCLUDE commands, the retrieved source will contain the same INCLUDE commands.
If program TEXT1 was created using the Create Bound CL Program (CRTBNDCL) command, the CL source is retrieved from module TEXT1 within program TEXT1.
Example 2: Retrieving the Expanded CL Source
RTVCLSRC PGM(MYAPP1) SRCFILE(RTVAPPSRC) RTVINCSRC(*YES)
This command retrieves the source statements from the CL program named MYAPP1 located using the library list. The retrieved CL source statements are placed into member MYAPP1 of source file RTVAPPSRC, which is also located using the library list. If the original CL source contained INCLUDE commands, the retrieved CL source will contain the included CL source in place of the INCLUDE commands.
Example 3: Retrieving CL Source from an ILE Program
RTVCLSRC PGM(ACCTRCV) MODULE(GETACCT)
This command retrieves the CL source statements from module GETACCT which is part of the integrated language environment (ILE) program named ACCTRCV. Program ACCTRCV is located using the library list. The retrieved CL source statements are placed into member GETACCT of source file QCLSRC, which is also located using the library list. If the original CL source contained INCLUDE commands, the retrieved source will contain the same INCLUDE commands.
Example 4: Retrieving CL Source from a Service Program
RTVCLSRC SRVPGM(AR_LIB/AR_PROCS) MODULE(GETCUST) SRCFILE(AR_SRC) RTVINCSRC(*YES)
This command retrieves the source statements from module GETCUST which is part of the integrated language environment (ILE) service program AR_PROCS located in library AR_LIB. The retrieved CL source statements are placed into member GETCUST of source file AR_SRC, which is also located using the library list. If the original CL source contained INCLUDE commands, the retrieved CL source will contain the included CL source in place of the INCLUDE commands.
Example 5: Retrieving CL Source from a CL Module
RTVCLSRC MODULE(TOOLSLIB/MAILPDF) SRCFILE(TOOLSLIB/QCLSRC)
This command retrieves the CL source statements from module MAILPDF which is located in library TOOLSLIB. The retrieved CL source statements are placed into member MAILPDF of source file QCLSRC, which is also located in library TOOLSLIB. If the original CL source contained INCLUDE commands, the retrieved source will contain the same INCLUDE commands.
Top |
*ESCAPE Messages
Top |