Convert RPG Source (CVTRPGSRC)

Convert RPG Source

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

Parameters

Keyword Description Choices Notes
FROMFILE From file Qualified object name Required, Positional 1
Qualifier 1: From file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
FROMMBR From member Generic name, name, *ALL Required, Positional 2
TOFILE To file Single values: *NONE
Other values: Qualified object name
Optional, Positional 3
Qualifier 1: To file Name, QRPGLESRC
Qualifier 2: Library Name, *LIBL, *CURLIB
TOMBR To member Name, *FROMMBR Optional, Positional 4
EXPCPY Expand copy member *NO, *YES Optional
CVTRPT Print conversion report *YES, *NO Optional
SECLVL Include second level text *NO, *YES Optional
INSRTPL Insert specification template *NO, *YES Optional
LOGFILE Log file Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: Log file Name, QRNCVTLG
Qualifier 2: Library Name, *LIBL, *CURLIB
LOGMBR Log file member Name, *FIRST, *LAST Optional

From file (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.

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.

From member (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).

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

To file (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.

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.

To member (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.

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

Expand copy member (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.

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

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.

Print conversion report (CVTRPT)

Specifies whether or not a conversion report is printed.

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

Include second level text (SECLVL)

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

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

Insert specification template (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).

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

Log file (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.

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.

Log file member (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.

*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

Example 1: Converting RPG III Source to RPG IV Source

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.

Error messages

*ESCAPE Messages

RNS9350
Conversion terminated.