BookmarkSubscribeRSS Feed
JuanVte
Calcite | Level 5
Dear all,

I am conducting simulations and for some iterations I got a warning message because the model does not converge. In these cases I have to repeat the iteration because I want to reach 10000 iterations without any warning.

To do such a thing I was thinking to use the macro variable SYSWARNINGTEXT but I found that this macro is not updated until the next warning message, so I can not detect when after a model with a warning message I have a correct one.

For example:

data a;
set doesnotexist;
run;

%put &SYSWARNINGTEXT;

data b;
set _NULL_;
run;

%put &SYSWARNINGTEXT;

Any idea?

Many thanks,
Juanvte.
1 REPLY 1
JuanVte
Calcite | Level 5
I solved with the SYSERR macro variable.

SYSERR can contain the following values:

Value Description
0 Execution completed successfully and without warning messages.
1 Execution was canceled by a user with a RUN CANCEL statement.
2 Execution was canceled by a user with an ATTN or BREAK command.
3 An error in a program run in batch or non-interactive mode caused SAS to enter syntax-check mode.
4 Execution completed successfully but with warning messages.
5 Execution was canceled by a user with an ABORT CANCEL statement.
6 Execution was canceled by a user with an ABORT CANCEL FILE statement.
>6 An error occurred. The value returned is procedure-dependent.


Regards,
Juanvte

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1099 views
  • 0 likes
  • 1 in conversation