BookmarkSubscribeRSS Feed
Calcite | Level 5

Is there a way to stop IML exit when it gets errors? That's because I have to re-run everything again in IML after it exits.

It is possible IML exits when it encounters a certain number of errors, so perhaps I can limit this number.

See the following log of my program:

90   create mydata from tt01[colname=namevar];

ERROR: Matrix tt01 has not been set to a value.

statement : CREATE at line 90 column 1

91   append from tt01;

ERROR: No data set is currently open for output.

statement : APPEND at line 91 column 1

92   close mydata;

NOTE: Cannot close WORK.MYDATA; it is not open.


94   create mydata from ta01[colname=namevar];

ERROR: Operand namevar does not have a value.

statement : CREATE at line 94 column 1

NOTE: Exiting IML.

NOTE: Storage library SASUSER.MYMODULES closed.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE IML used (Total process time):

      real time           26:06.64

      cpu time            25.25 seconds


Wow. I never knew SAS/IML did that.  How many errors are there? Is there a reason why you don't or can't fix the errors?

For unititialized variables, perhaps you could try something like:

   if ncol(tt01)=0 then stop;

Another option:

   if ncol(tt01)=0 then store _all_;  /* save matrices in case IML exits */

I don't know if any of these will work. I know that there are a lot of system options that SAS supports for handling errors. See if the options on this page are useful: SAS(R) 9.2 Language Reference: Concepts, Second Edition


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.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 2 in conversation