Paroling RPG4 - Step 3 of 4

Submitted by NickLitten on Sat, 09/12/2009 - 20:12

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

 
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

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Some Bloke

Projex dot com is the cyber home of Nick Litten an AS400 IBMi developer, RPG programmer, SOA code enthusiast, website tinkerer, information technology evangelist, early adopter, proponent of open source and hopeless technology addict...

Nick Litten looking dazed while refactoring some RPG2 code to kick it into this century

Born and raised in Rainy England, now enjoying programming in the sunshine of Southern USA. Founder of SOFTWARE PROJEX.

Clustermap

Locations of visitors to this page

glqxz9283 sfy39587stf02 mnesdcuix8
sfy39587stf03
sfy39587stf04