Converting Your Source

This section explains how to convert source programs to the RPG IV format. It discusses the command CVTRPGSRC, which starts the Conversion Aid, and how to use it.

To convert your source code to the RPG IV format, follow these general steps:

  1. If you use a data area as a control specification, you must create a new data area in the RPG IV format. Refer to the chapter on control specifications in IBM Rational Development Studio for i: ILE RPG Reference for more information.
  2. Create a log file, if necessary.

    Unless you specify LOGFILE(*NONE), there must be a log file for the Conversion Aid to access. If you do not have one, then you can create one by using the CRTDUPOBJ command. For more information, see The Log File and Using the Log File.

  3. Create the file for the converted source members.

    The Conversion Aid will not create any files. You must create the output file for the converted source prior to running the CVTRPGSRC command. The recommended name and record length for the output file is QRPGLESRC and 112 characters respectively. For additional file information see File Considerations.

  4. Convert your source using the CVTRPGSRC command.

    You need to enter the name of the file and member to be converted. If you accept the defaults, you will get a converted member in the file QRPGLESRC. The name of the member will correspond to the name of the unconverted source member. /COPY members will not be expanded in the converted source member, unless it is of type RPT or RPT38. A conversion report will be generated.

    See The CVTRPGSRC Command for more information.

  5. Check the log file or the error report for any errors. For more information, see Analyzing Your Conversion.
  6. If there are errors, correct them and go to step 4.
  7. If there are no errors, create your program. For information on how to create ILE RPG programs, see Creating a Program with the CRTBNDRPG Command.
  8. If your converted source member still has compilation problems, these are most likely caused because your primary source member contains /COPY compiler directives. You have two choices to correct this situation:
    1. Reconvert your source member specifying EXPCPY(*YES) to expand copy members into your converted source member.
    2. Manually correct any remaining errors using the compiler listing as a guide.
    Refer to Resolving Conversion Problems for further information.
  9. Once your converted source member has compiled successfully, retest the program before putting it back into production.


[ Top of Page | Previous Page | Next Page | Contents | Index ]