Is it possible? I'm using WDSC but haven't been able to figure it out. If I copy and paste from RPG into RPGLE the columns don't line up. How do I get the old code to line up in the new columns without going through and editing each line of a 4000 line program?
Announcement
Collapse
No announcement yet.
Converting an RPG source member to an RPGLE source member
Collapse
X
-
Re: Converting an RPG source member to an RPGLE source member
Hi,
copy and paste will not convert an RPGIII source into an RPGIV source, for converting a RPGIII source you need to execute the CL command CVTRPGSRC.
If you have to convert a bunch of RPGIII sources, you may intend to create an user action.
Birgitta
-
Re: Converting an RPG source member to an RPGLE source member
Here's a little CL I have used. Its just calling the IBM program, but does make a backup in CRPG3SAVED source file in case you need it back. This can be added as a PDM option or WDSc User action.
Code: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
Comment
-
Re: Converting an RPG source member to an RPGLE source member
in every place i've been the RPG III stuff has been in QRPGSRC, i just create the source file QRPGLESRC and CVTRPGSRC and have the resulting RPG IV source fo there, i have the original in QRPGSRC and the brand-spanking new source in QRPGLESRC...but that's just meI'm not anti-social, I just don't like people -Tommy Holden
Comment
-
Re: Converting an RPG source member to an RPGLE source member
in every place i've been the RPG III stuff has been in QRPGSRC, i just create the source file QRPGLESRC
Comment
-
Re: Converting an RPG source member to an RPGLE source member
The CVTRPGSRC only does a minimal conversion. There are some other resources for making it more RPG-ILE and/or Free Format.
These would take something like
A IFEQ B
and convert to
If A = B
The one for free is Craig Rutledge's utilities
Linoma Software also has one:
NOTE: The info below may or may not be correct. If anyone else know knows if this is correct or not, please chime in.
For most situations, Craig's should do the trick. If I recall, Linoma's has some additional tweaking it can do. Example:
31 32 33 Exsr MySubr1
31 32 33 Exsr MySubr2
31 32 33 Exsr MySubr3
31 32 33 Exsr MySubr4
Linoma would convert this to
If (*IN31 = *ON) AND (*IN32 = *ON) AND (*IN33 = *ON)
Exsr MySubr1
Exsr MySubr2
Exsr MySubr3
Exsr MySubr4
EndIf
Comment
-
Re: Converting an RPG source member to an RPGLE source member
Originally posted by Chipper View PostThe CVTRPGSRC only does a minimal conversion. There are some other resources for making it more RPG-ILE and/or Free Format.
These would take something like
A IFEQ B
and convert to
If A = B
The one for free is Craig Rutledge's utilities
Linoma Software also has one:
NOTE: The info below may or may not be correct. If anyone else know knows if this is correct or not, please chime in.
For most situations, Craig's should do the trick. If I recall, Linoma's has some additional tweaking it can do. Example:
31 32 33 Exsr MySubr1
31 32 33 Exsr MySubr2
31 32 33 Exsr MySubr3
31 32 33 Exsr MySubr4
Linoma would convert this to
If (*IN31 = *ON) AND (*IN32 = *ON) AND (*IN33 = *ON)
Exsr MySubr1
Exsr MySubr2
Exsr MySubr3
Exsr MySubr4
EndIfI'm not anti-social, I just don't like people -Tommy Holden
Comment
Comment