RPG III to RPG IV conversion

30 pts.
Tags:
AS/400
RPG Programming
RPGILE
how to convert rpg iii code into rpg iv?

Software/Hardware used:
as/400 ile rpg
ASKED: December 16, 2010  8:50 AM
UPDATED: December 21, 2010  5:52 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

YOu can use CVTRPGSRC command to do this.
The Convert RPG Source (CVTRPGSRC) command converts RPG III
or RPG/400 source code to ILE RPG source code

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Check out the command CVTRPGSRC
    48,545 pointsBadges:
    report
  • TomLiotta
    Simplest way is to run the source through the CVTRPGSRC 'Convert RPG Source' command. Compile the resulting RPG IV source into a test environment before deciding to go forward with it. Since some elements of RPG III don't translate cleanly to RPG IV, you should review the new source to decide if you want to put much cleanup effort into the source to take advantage of new builtin functions or op-codes or data definitions. Compile first as straight DFTACTGRP(*YES) to maintain RPG III run-time compatibility. That's the absolute minimum description of converting RPG III to RPG IV. It's possible that much of what you do will be no more than that, but there will also be spots where you need to know more. Before attempting any real conversion, read the Using the RPG III to RPG IV Conversion Aid topic in the Information Center. Read through all of the pages by clicking the 'Next page' links at the bottom of each page. Single programs can convert pretty easily. But whole applications can require knowing how all of the pieces fit together. At some point, there will be relationships like overrides where one program affects how another program runs. If you don't pay attention to the relationships, things can get confusing when they work just a little differently. Tom
    125,585 pointsBadges:
    report
  • AS1
    Here's a little CL PGM CONVERT RPGIII TO RPG 1V. PGM PARM(&PROGRAM &SOURCE &LIBRARY) DCL VAR(&PROGRAM) TYPE(*CHAR) LEN(10) DCL VAR(&LIBRARY) TYPE(*CHAR) LEN(10) DCL VAR(&SOURCE) TYPE(*CHAR) LEN(10) DCL VAR(&SRCTYPE) TYPE(*CHAR) LEN(10) /* IF NOT RPG3, SKIP ALL PROCESSING */ RTVMBRD FILE(&LIBRARY/&SOURCE) MBR(&PROGRAM) + SRCTYPE(&SRCTYPE) IF COND(&SRCTYPE *NE 'RPG ') THEN(DO) SNDMSG MSG('Convert failed. ' *CAT &PROGRAM *TCAT ' + is not a RPG3 program.') TOUSR(*REQUESTER) GOTO END ENDDO CHKOBJ OBJ(&LIBRARY/CRPG3SAVED) OBJTYPE(*FILE) MONMSG MSGID(CPF9801) EXEC(CRTSRCPF + FILE(&LIBRARY/CRPG3SAVED) RCDLEN(120) + TEXT('Saved RPG3 prior to conversion')) CPYSRCF FROMFILE(&LIBRARY/&SOURCE) + TOFILE(&LIBRARY/CRPG3SAVED) FROMMBR(&PROGRAM) RMVM FILE(&LIBRARY/&SOURCE) MBR(&PROGRAM) CVTRPGSRC FROMFILE(&LIBRARY/CRPG3SAVED) + FROMMBR(&PROGRAM) TOFILE(&LIBRARY/&SOURCE) END: ENDPGM
    90 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following