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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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