Paroling RPG4 - Step 3 of 4
Upgrade RPG4 to use free-friendly code standards
If we were using Rational Developer/i software we could do this automatically. But as a manual process its simple, if a little tedious. Basically when we are going to skim through the code and replace all indicators with the modern and preferred %FOUND BIF technique:
H debug
*****************************************************************
* *
* system name: fix slp06 *
* *
* program desc: fix the records on slp06 *
* *
* program no: ef001 *
* *
* date: 09/09/09 (sadly not at 9:09) *
* *
* author: Nick.Litten@projex.com *
* *
*****************************************************************
Fefp01l01 if e k disk infsr(*pssr)
Facsummar uf e k disk infsr(*pssr)
D lda e ds extname(lda)
D pstat esds extname(psds)
C *dtaara define *lda lda
C in lda
C l#cono setll acsummar
C l#cono reade acsummar
1b C dow not %eof(acsummar)
C cusn06 chain efp01l01
2b C if %found(efp01l01)
C eval bodv06 = amount
2x C else
C eval bodv06 = 0
2e C endif
C update slr06
C l#cono reade acsummar
1e C enddo
C eval *inlr = *on
C out lda
?*****************************************************************
?* standard error handling routine.
?/Copy qgpl/qrpglesrc,pssr
*****************************************************************
* *
* system name: fix slp06 *
* *
* program desc: fix the records on slp06 *
* *
* program no: ef001 *
* *
* date: 09/09/09 (sadly not at 9:09) *
* *
* author: Nick.Litten@projex.com *
* *
*****************************************************************
Fefp01l01 if e k disk infsr(*pssr)
Facsummar uf e k disk infsr(*pssr)
D lda e ds extname(lda)
D pstat esds extname(psds)
C *dtaara define *lda lda
C in lda
C l#cono setll acsummar
C l#cono reade acsummar
1b C dow not %eof(acsummar)
C cusn06 chain efp01l01
2b C if %found(efp01l01)
C eval bodv06 = amount
2x C else
C eval bodv06 = 0
2e C endif
C update slr06
C l#cono reade acsummar
1e C enddo
C eval *inlr = *on
C out lda
?*****************************************************************
?* standard error handling routine.
?/Copy qgpl/qrpglesrc,pssr
Not that all indicators have been removed and I would also change Z-ADD, MOVE and MOVEL statements into EVAL's. I switch the code into lowercase, a personal preference, because I like it that way.
At this point I added some commenting, cause thats the kind of guy I am.
Last but not least is the conversion to RPG /FREE








Add new comment