Midware Ltd.
|
Sign-up for e-mail notifications
|
Because there are syntax differences, IBM has included the CVTRPGSRC command to automatically convert RPG III source code to RPG IV. Before using this utility, you should create new source files (or change your existing ones) to have a record length of 112 bytes. This is necessary because the format of source records was changed to support expanded field names and op-codes. Enter the CVTRPGSRC command in the following format:
The FROMFILE and FROMMBR parameters should indicate the old RPG III source file and member. The TOFILE and TOMBR parameters should indicate the name and location where the generated RPG IV source code will be placed.
When the command completes, you will have an RPG IV version of the program in the specified location. Note that if you have any "/copy" statements in your program, the copy member(s) will also need to be converted. The CVTRPGSRC command will simply convert your RPG III code line-by-line to RPG IV syntax. It will not automatically update your code to use the enhanced RPG IV op-codes (such as Eval) .
Start by converting a small, working program that you are familiar with and look at the results. Use PDM option 14 to compile the program. Notice that the command CRTBNDRPG (Create Bound RPG Program) is used instead of CRTRPGPGM (Create RPG Program). This is a one-step compile process, as opposed to the two-step process we'll cover in the ILE section. Your program should compile and run normally. Now, go back to the original RPG III program and add a data-structure and a table or array. Perform the conversion again and see how it converted those elements. Before you proceed to the language element sections, there are a few important points you should know about the differences between ILE programs and Original Program Model (OPM) programs..
|
Send mail to midware@midwareservices.com
with questions or comments about this web site. Last Modified: August 18, 2000 |