Uhhh, you're going to need a SET statement somewhere inside the outer DO/END loop, and I suggest exploring the use of LEAVE and CONTINUE, as well, depending on your circumstances. Also, the STOP; statement possibly for premature DATA-step termination.
Although, you also need to understand about SAS DATA step pass behavior when running a DO/END with an interior SET statement -- effectively you only execute one DATA step pass (depends on the application rqmt though).
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search argument, this topic / post:
data step programming intro site:sas.com