looping macros

I have a macro that reads data, and want to run it for 2007 to 2017. Currently I made two macros, one for 1 digit year and another for 2 digit year, and am typing it out

!readDat dig1Yr = 7.
!readDat dig1Yr = 8.
!readDat dig1Yr = 9.

!readDat dig2Yr = 10.
!readDat dig2Yr = 11.
!readDat dig2Yr = 12.

Is it possible to make a loop instead? I tried:

set mxloops = 7.
loop.
compute year = 10.
execute.
!readDat dig2Yr = year.
compute year = year + 1.
execute.
end loop.

and it didn’t work. Any ideas?

Related:

Leave a Reply