And, consider where your SET statement is located, relative to the DO UNTIL / END logic -- your DATA step flow will not iterate back to the top without encountering a SET / BY operation.
Suggest you re-think your DATA step flow. Also, make use of SAS diagnostic statements (one or more), such as:
PUTLOG ">DIAG-nnn>"_ALL_;
at important points (you increment "nnn" for identification in the log) in your DATA step so you can see how the flow is going at any one point.
Scott Barry
SBBWorks, Inc.