BookmarkSubscribeRSS Feed
Bogdan
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.

93

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

1 REPLY 1
Rick_SAS
SAS Super FREQ

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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1310 views
  • 0 likes
  • 2 in conversation