Nested DO, DOWxx, DOUxx, FOR, SELECT/WHENxx, and IF/THEN/ELSE levels appear in several examples. Occasionally a graphic is used to illustrate nesting levels. The source code may be indented for clarity and does not represent exact coding statement, but rather the nesting level of the source code. Example 5.3 illustrates this indented nesting graphic. The operation code columns are extended in this nested view of RPG source code.
Example 5.3: Graphic illustration of RPG nesting.
.....CL0n01Factor1+++++++<26 to 35>Factor2+++++++Result++++++++Len++DcHiLoEq C IF %Status = 0 C | DOW %eof(CUSTMAST) = *OFF AND Count <= 20 C | | WRITE SFL001 C | | IF NOT %EOF(SFL001) C | | | ADD 1 COUNT C | | | READ CUSTMAST C | | ENDIF C | ENDDO C ENDIF