Figure 1: An old RPG/400 customer maintenance program

  FCUSTFILEUF  E           K        DISK                      A

     FCUSTS   CF  E                    WORKSTN

     E                    ERR     1   8 60

     C                     EXSR SCRN1

     C                     EXSR SCRN2

     C        N12          EXSR UPDATE

     C        N12          EXSR CLEAR

      *****************************************************

      * ASK FOR CUSTOMER NUMBER

      *****************************************************

     C           SCRN1     BEGSR

     C           SCMSG     DOUEQ*BLANKS

      *

      

     C                     EXFMTCUSTS1

		
A
     C                     MOVE *BLANKS   SCMSG

		
B
     

      *

      

     C           *IN03     IFEQ *ON

     C                     MOVE *ON       *INLR

     C                     RETRN

     C                     ENDIF

		
C
     

      *

      

     C           SCCUST    CHAINCUSTFILE            N99

     C           *IN99     IFEQ *ON

     C           *IN10     ANDEQ*OFF

     C                     MOVELERR,1     SCMSG

     C                     ENDIF

      *

     C           *IN99     IFEQ *OFF

     C           *IN10     ANDEQ*ON

     C                     MOVELERR,2     SCMSG

     C                     ENDIF

		
D
     

      *

     C                     ENDDO

     C                     ENDSR