DATA Step, Macro, Functions and more

Working with SYSWARNINGTEXT macro variable

Reply
Contributor
Posts: 43

Working with SYSWARNINGTEXT macro variable

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.
Contributor
Posts: 43

Re: Working with SYSWARNINGTEXT macro variable

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
Ask a Question
Discussion stats
  • 1 reply
  • 288 views
  • 0 likes
  • 1 in conversation