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: 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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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