The CVTRPGSRC Command
To convert your RPG III or RPG/400® source to the new RPG IV format, you use the CVTRPGSRC command to start the Conversion Aid. CVTRPGSRC Parameters and Their Default Values Grouped by Function shows the parameters of the command based on their function.
CVTRPGSRC Parameters and Their Default Values Grouped by Function
| Parameter | Description |
|---|---|
| FROMFILE | Identifies library and file name of RPG source to be converted |
| FROMMBR | Identifies which source members are to be converted |
| TOFILE(*LIBL/QRPGLESRC) | Identifies library and file name of converted output |
| TOMBR(*FROMMBR) | Identifies file member names of converted source |
| Parameter | Description |
|---|---|
| TOMBR | If *NONE is specified, then no file members are saved |
| EXPCPY(*NO) | Determines if ⁄COPY statements are included in converted output |
| INSRTPL(*NO) | Indicates if specification templates are to be included in converted output |
| Parameter | Description |
|---|---|
| CVTRPT(*YES) | Determines whether to produce conversion report |
| SECLVL(*NO) | Determines whether to include second-level message text |
| LOGFILE(*LIBL/QRNCVTLG) | Identifies log file for audit report |
| LOGMBR(*FIRST) | Identifies which member of the log file to use for audit report |
CVTRPGSRC command syntax
The syntax for
the CVTRPGSRC command is shown below.
Job: B,I Pgm: B,I REXX: B,I Exec
>>-CVTRPGSRC----------------------------------------------------> .-*LIBL/--------. >--FROMFILE--(--+---------------+----source-file-name----)------> +-*CURLIB/------+ '-library-name/-' .-source-file-member-name-. >--FROMMBR--(--+-*ALL--------------------+--)-------------------> '-generic*-member-name----' >--+-----------------------------------------------------------+--> | .-*LIBL/--------. .-QRPGLESRC--------. | '-TOFILE--(--+-+---------------+--+-source-file-name-+-+--)-' | +-*CURLIB/------+ | | '-library-name/-' | '-*NONE-----------------------------------' (1) >--+------------------------------------------+-----------------> | .-*FROMMBR----------------. | '-TOMBR--(--+-source-file-member-name-+--)-' >--+------------------------+--+------------------------+-------> | .-*NO--. | | .-*YES-. | '-EXPCPY--(--+-*YES-+--)-' '-CVTRPT--(--+-*NO--+--)-' >--+------------------------+--+-------------------------+------> | .-*NO--. | | .-*NO--. | '-SECLVL--(--+-*YES-+--)-' '-INSRTPL--(--+-*YES-+--)-' >--+---------------------------------------------------------+--> | .-*LIBL/--------. .-QRNCVTLG------. | '-LOGFILE--(--+-+---------------+--+-log-file-name-+-+--)-' | +-*CURLIB/------+ | | '-library-name/-' | '-*NONE--------------------------------' >--+----------------------------------------+------------------>< | .-*FIRST---------------. | '-LOGMBR--(--+-*LAST----------------+--)-' '-log-file-member-name-'
Notes:
- All parameters preceding this point can be specified by position.
The parameters and their possible values
follow the syntax diagram. If you need prompting, type CVTRPGSRC and
press F4. The CVTRPGSRC screen appears, lists the parameters, and
supplies default values. For a description of a parameter on the display,
place your cursor on the parameter and press F1. Extended help for
all of the parameters is available by pressing F1 on any parameter
and then pressing F2.
- FROMFILE
- Specifies the name of
the source file that contains the RPG III or RPG 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.
- FROMMBR
- Specifies the name(s)
of the 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*-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'.
(See the CL Programmer's Guide for more information on the generic name.)
- TOFILE
- Specifies the name of the
source file that contains 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 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.
- 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.
- EXPCPY
- Specifies whether or not
/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.
- *NO
- Do not expand the /COPY file member(s) into the converted source.
- *YES
- Expands the /COPY file member(s) into the converted source.
- CVTRPT
- Specifies whether or not
a conversion report is printed.
- *YES
- The conversion report is printed.
- *NO
- The conversion report is not printed.
- SECLVL
- Specifies whether second-level
text is printed in the conversion report in the message summary section.
- *NO
- Second-level message text is not printed in the conversion report.
- *YES
- Second-level message text is printed in the conversion report.
- 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). The default
value is *NO.
- *NO
- A specification template is not inserted in the converted source member.
- *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
- 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.
- 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.
- *LAST
- The command uses the last member in the specified log file.
- log-file-member-name
- Enter the name of the log file member used to track conversion information.
