ABSTRACT

The output from the program is shown in Figure 23.2. It is possible to have nested DO loops. If so, each must have its own ENDDO statement.

DO &J = 2,6 CLEAR RMULT 54321 TRUCKS GENERATE ,,,&J DO &I = 1,3 STORAGE S(TUGS),&I START 1 ENDDO ENDDO

The value of &J is first set equal to 2. The Block

TRUCKS GENERATE ,,,&J

would become

TRUCKS GENERATE ,,,2

next, the value of I is 1 and the STORAGE is as follows:

STORAGE S(TUGS),1

The program is run for these values. The value of &I is next incremented to 2 and the program run with the STORAGE of TUGS equal to 2 (&J remains equal to 2). Thus, the main program will be executed 15 times (&J = 2,3,4,5,6 and &I = 1,2,3).