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



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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