In reply to tina.

The SAS/IML language supports the DO UNTIL and DO WHILE statements. A common programming paradigm is to set FLAG=0 (which is false) and then
DO UNTIL(FLAG);
/* generate random numbers and set FLAG=1 if a condition is satisfied */
end;
If you are running an acceptance-rejection simulation, here are some efficiency tips.