Command reference / prog

CVTRPGSRC

Convert RPG Source

The Convert RPG Source (CVTRPGSRC) command converts RPG III or RPG/400 source code to ILE RPG source code.

Allowed environments: *ALL. Positional parameters: 4.

Parameters

FROMFILE FROMFILE

Specifies the name of the source file that contains the RPG III or RPG/400 source code to be converted and the library where the source file is stored. This is a required parameter; there is no default file name.

Type
*QUAL
Required
Yes
Case
Uppercase
source-file-name
Enter the name of the source file that contains the source member(s) to be converted.
*LIBL
The system searches the library list to find the library where the source file is stored.
*CURLIB
The current library is used to find the source file. If you have not specified a current library, then the library QGPL is used.
library-name
Enter the name of the library where the source file is stored.
Qualified parts (object, then library; write LIBRARY/OBJECT)

FROMFILE FROMFILE

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

FROMMBR FROMMBR

Specifies the name(s) of the source member(s) to be converted. This is a required parameter; there is no default member name. The valid source member types of source members to be converted are RPG, RPT, RPG38, RPT38, SQLRPG and blank. The Convert RPG Source command does not support source member types RPG36, RPT36 and other non-RPG source member types (for example, CLP and TXT).

Type
*GENERIC
Required
Yes
Length
10
Case
Uppercase

Suggested / special values: *ALL

source-file-member-name
Enter the name of the source member to be converted.
*ALL
The command converts all the members in the source file specified.
generic*-source-file-member-name
Enter the generic name of members having the same prefix in their names followed by a '*' (asterisk). The command converts all the members having the generic name in the source file specified. For example, specifying FROMMBR(PR*) will result in the conversion of all members whose names begin with 'PR'.

TOFILE TOFILE

Specifies the name of the source file that contains the converted source members and the library where the converted source file is stored. The converted source file must exist and should have a record length of 112 characters: 12 for the sequence number and date, 80 for the code and 20 for the comments.

Type
*QUAL
Required
No
Case
Uppercase

Suggested / special values: *NONE

QRPGLESRC
The default source file QRPGLESRC contains the converted source member(s).
*NONE
No converted source member is generated. The TOMBR parameter value is ignored. CVTRPT(*YES) must also be specified or the conversion will end immediately. This feature allows you to find some potential problems without having to create the converted source member.
source-file-name
Enter the name of the converted source file that contains the converted source member(s). The TOFILE source file name must be different from the FROMFILE source file name if the TOFILE library name is the same as the FROMFILE library.
*LIBL
The system searches the library list to find the library where the converted source file is stored.
*CURLIB
The current library is used to find the converted source file. If you have not specified a current library then the library QGPL is used.
library-name
Enter the name of the library where the converted source file is stored.
Qualified parts (object, then library; write LIBRARY/OBJECT)

TOFILE TOFILE

Type
*NAME
Required
No
Default
QRPGLESRC
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

TOMBR TOMBR

Specifies the name(s) of the converted source member(s) in the converted source file. If the value specified on the FROMMBR parameter is (*ALL) or generic*, then TOMBR must be equal to *FROMMBR.

Type
*NAME
Required
No
Default
*FROMMBR
Length
10
Case
Uppercase

Suggested / special values: *FROMMBR

*FROMMBR
The member name specified in the FROMMBR parameter is used as the converted source member name. If FROMMBR(*ALL) is specified, then all the source members in the FROMFILE are converted. The converted source members have the same names as those of the original source members. If a generic name is specified in the FROMMBR parameter, then all the source members specified having the same prefix in their names are converted. The converted source members have the same names as those of the original generic source members.
source-file-member-name
Enter the name of the converted source member. If the member does not exist, it will be created.

EXPCPY EXPCPY

Specifies whether a /COPY member(s) is expanded into the converted source member. EXPCPY(*YES) should be specified only if you are having conversion problems pertaining to /COPY members. Note: If the member is of type RPT or RPT38, EXPCPY(*YES) or EXPCPY(*NO) has no effect because the auto report program will always expand the /COPY members.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Do not expand the /COPY file member(s) into the converted source. This is the default.
*YES
Expand the /COPY file member(s) into the converted source.

CVTRPT CVTRPT

Specifies whether or not a conversion report is printed.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

*YES
The conversion report is printed. This is the default.
*NO
The conversion report is not printed.

SECLVL SECLVL

Specifies whether second-level text is printed in the conversion report.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Second-level message text is not printed in the conversion report. This is the default.
*YES
Second-level message text is printed in the conversion report.

INSRTPL INSRTPL

Specifies if the ILE RPG specification templates (H-, F-, D-, I-, C- and/or O-specification template) are inserted in the converted source member(s).

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
A specification template is not inserted in the converted source member. This is the default.
*YES
A specification template is inserted in the converted source member. Each specification template is inserted at the beginning of the appropriate specification section.

LOGFILE LOGFILE

Specifies the name of the log file that is used to track the conversion information. Unless *NONE is specified, there must be a log file. The file must already exist, and it must be a physical data file. Create the log file by using the CPYF command with the "From object" file QARNCVTLG in library QRPGLE and the "New object" file QRNCVTLG in your library.

Type
*QUAL
Required
No
Case
Uppercase

Suggested / special values: *NONE

QRNCVTLG
The default log file QRNCVTLG is used to contain the conversion information.
*NONE
Conversion information is not written to a log file.
log-file-name
Enter the name of the log file that is to be used to track the conversion information.
*LIBL
The system searches the library list to find the library where the log file is stored.
library-name
Enter the name of the library where the log file is stored.
*CURLIB
Use the current library to find the log file.
Qualified parts (object, then library; write LIBRARY/OBJECT)

LOGFILE LOGFILE

Type
*NAME
Required
No
Default
QRNCVTLG
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

LOGMBR LOGMBR

Specifies the name of the log file member used to track conversion information. The new information is added to the existing data in the specified log file member. If the log file contains no members, then a member having the same name as the log file is created.

Type
*NAME
Required
No
Default
*FIRST
Length
10
Case
Uppercase

Suggested / special values: *FIRST, *LAST

*FIRST
The command uses the first member in the specified log file. This is the default.
*LAST
The command uses the last member in the specified log file.
log-file-member-name
Enter the name of the file member used to track conversion information.

Examples

CVTRPGSRC FROMFILE(MYLIB/QRPGSRC) FROMMBR(XMPLE1) TOFILE(MYLIB/QRPGLESRC) TOMBR(*FROMMBR) EXPCPY(*NO) CVTRPT(*YES) LOGFILE(MYLIB/QRNCVTLG)

This command converts the RPG III source member XMPLE1 in file MYLIB/QRPGSRC to an RPG IV source member of the same name in file MYLIB/QRPGLESRC. /COPY statements in the RPG III program are not expanded; they remain as /COPY statements in the RPG IV program. A report is printed. The status of each conversion is placed in the file MYLIB/QRNCVTLG.

IBM command documentation

Generated from os/cl/catalog/CVTRPGSRC.json and os/cl/help/CVTRPGSRC.json.