BookmarkSubscribeRSS Feed
Luke
Calcite | Level 5
Hi,
If a Do loop in IML procedure never reaches its stopping criterion, it will keep running. Anyone knows how to stop the IML procedure automatically after a specified time and jump to next procedure?
Thanks in advance.

Luke
1 REPLY 1
Hutch_sas
SAS Employee
You can program a time limit in the loop itself:

proc iml;
t0 = time(); /* units of the time() function are seconds */
time_limit = 5;
do while( (time()-t0)< time_limit);
x = 1; /* do your loop */
end;
print time_limit "elapsed time " (time() - t0);

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 664 views
  • 0 likes
  • 2 in conversation