Convert CL Source (CVTCLSRC)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Convert CL Source (CVTCLSRC) command is used to convert Control Language (CL) source code from System/38 syntax to the syntax used on the iSeries system. The following are converted:

Conversion of user-defined commands is limited to the reordering of qualified names and adjusting comment syntax.

The CVTCLSRC command creates a report indicating the success or failure of the source file conversion. This report is contained in a printer file with the name 'CVTCLSRC'. Successful conversions of System/38 source are noted in the report with the message:

CPF0786   Member has been converted.

Error messages are printed for unsuccessful conversions. Some examples of functions which cannot be converted and may be printed as error messages in the report are:

stmt#  CPF0785  Command cannot be converted
stmt#  CPF0789  Keyword cannot be converted

The user may write a program, perhaps by using the Copy Spooled File (CPYSPLF) command, to process the report based on the success or failure of the conversion.

Restrictions: Library QSYS38 must exist on the system to support the conversions and to detect unsupported functions. Commands with unsupported command name, keyword names, or keyword values are not converted.

Top

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
TOFILE To file Qualified object name Required, Positional 2
Qualifier 1: To file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
FROMMBR From member Single values: *ALL
Other values (up to 50 repetitions): Generic name, name
Required, Positional 3
Top

From file (FROMFILE)

Specifies the System/38 CL source file to have its syntax converted.

This is a required parameter.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the source file. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

To file (TOFILE)

Specifies the file to contain the converted CL source. It must be different than the name specified for the FROMFILE parameter.

This is a required parameter.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the source file. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

Member (FROMMBR)

Specifies the members of the file specified for the From file (FROMFILE) parameter that are to be converted.

*ALL
All members of the specified source file are to be converted.
generic-name
Specify the generic name of the members to be converted.
name
Specify the names of the members to be converted. Specify no more than fifty names. Note that the member name of the converted source member is the same as the member name of the unconverted source member in the file specified for the FROMFILE parameter.
Top

Examples

CVTCLSRC   FROMFILE(OLDLIB/FILEA)  TOFILE(NEWLIB/FILEB)
           FROMMBR(PGM1 PGM2 PGM3)

This command converts three members (PGM1, PGM2, PGM3) of a System/38 source file (FILEA) located in library OLDLIB, to an iSeries source file. The converted source file members are located in FILEB, in library NEWLIB. The converted members keep their original member names, PGM1, PGM2, and PGM3.

Top

Error messages

*ESCAPE Messages

CPF0781
File &1 in library &2 not a source file.
CPF0784
Specified to-file same as from-file.
Top