RPG Three becomes Four - Step 2 of 4

Submitted by NickLitten on Fri, 09/11/2009 - 18:52

CVTRPGSRC - IBM Command to upgrade RPG3 to RPG4

After running CVTRPGSRC on the old source a new member is created in QRPGLESRC:

      * program to fix SLP06 records
     H DEBUG
     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     K01           KLIST
     C                   KFLD                    CUSN06
     C     L#CONO        SETLL     ACSUMMAR
     C     L#CONO        READE     ACSUMMAR                               06
 1b  C                   DOW       *IN06        = *OFF
     C     K01           CHAIN     EFP01L01                           02
 2b  C                   IF        *IN02        = *OFF
     C                   EVAL      BODV06 = AMOUNT
 2x  C                   ELSE
     C                   EVAL      BODV06 = 0
 2e  C                   ENDIF
     C                   UPDATE    SLR06
     C     L#CONO        READE     ACSUMMAR                               06
 1e  C                   ENDDO
     C                   EVAL      *INLR = *ON
     C                   OUT       LDA
     ?*****************************************************************
     ?*  standard error handling routine.
     ?/Copy qgpl/qrpglesrc,pssr

 

As you can see the code if more or less the same, with the exception of few elements to make it more readable.

It's still using indicators, but if/do loops are now completed with relevant ENDIF/DO and EVAL statement have apeared.

Note - make sure any /COPY entries are also upgraded - otherwise trying to suck in RPG3 code from copybooks will upset the compiler

So far it's all been automatic, the CVTRPGSRC command is a wonderful thing.

Next step is to tidy up the code further so it morphs from a hybrid RPG3-4 to full blooded RPG4


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