NESTRPG is a helpful tool for programmers. A compile listing shows the nesting of all IF . . , DO.., WH.., etc. on the right hand side of the source listing. NESTRPG puts this same information in the rightmost positions of your RPG source member. These positions are visible through SEU when the programmer windows, starting at position six (W6).

Note: In order for the beginning and ending statement to be seen, the last three bytes of the comment field are overridden by NESTRPG.

In addition to it’s nesting features, NESTRPG also tracks the statement number of each BEGSR and GOTO tag on the left most margin (W1). This allows the programmer to know exactly where to find the subroutines and tags without having to use a scan.

The operation of NESTRPG is simple, on a command line, key in NESTRPG and prompt...


Figure 7.1

Program Name - The name of the program to be nested.

Source File Name - Source file containing program.

Library Name - Library containing source file.

Print Source *YES/*NO - Print *Yes will nest the source and print it showing subroutines and tags with the subroutines nested. Print *No will nest the source and document the tags and subroutines but it will not print.

Print From/To Sequence # - Will print only the statements in the source file that are from and to these sequence numbers.

The following page shows an example of how the nested statements and subroutines/tags will appear in SEU:

019000      C     KEY   SETLLARRPAYMT
020000      C     *IN99 DOUEQ‘1’                B001
020100      C     KEY   READEARPAYMT      99    001
020200      C     *IN99 IFEQ ‘0’                B002
020300      C           SELEC                   002
020400      C     TRAN# WHEQ ‘1’                B003
020500@0214 C           GOTO TRAN1              0003
020600      C     TRAN# WHEQ ‘2’                X003
020700@0229 C           EXSR TRAN2              003
020800      C           OTHER                   X003
020900@0220 C           GOTO ENDIT              003
021000      C           ENDSL                   E003
021100      C           END                     E002
021200      C           END                     E001
021300      C*
021400      C     TRAN1 TAG
:           C            :
022000      C     ENDIT TAG
:           C            :
:           C            :
022900      C     TRAN2 BEGSR
:           C            :
02300       C           ENDSR