When I execute the code below, I am having the following warning message:
WARNING: The relative Hessian convergence criterion of 0.2919725428 is greater than the limit
of 0.0001. The convergence is questionable.
WARNING: The procedure is continuing but the validity of the model fit is questionable.
However, if I show the content of the variable SYSERR, it is equal to 0 instead of 4, as indicated in sas documentation:
SYSERR can contain the following values:
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.
do k = 1 to 200;
x = 'pl';
y = rand('NEGBINOMIAL', 0.80, 1);
do k = 1 to 200;
x = 'tx';
y = rand('NEGBINOMIAL', 0.85, 1);
proc genmod data=sim_data;
class x (param=ref ref='pl');
model y = x / dist=NEGBIN ;
the problem is that SYSWARNINGTEXT is only updated with a new warning message. If you run a process that works, in this variables is still stored the previous warning message so I can not distinguish between the proces that works and the one that doesn't work.
yes, at the moment I will try that. However, I would like to control over other possible warnings. I am doing a macro to calculate required sample size based on GLMz models. For that I am doing simulations where if one of them doesn't work I have to repead. In general terms, I think (because I still don't know) that in 10,000 iteration I can find more problems than the convergence one, so I would like to have a general way to repeat any iteration with a warning message.
This works correctly at SAS 9.3 (which is about to be released -- keep sitting there).
As for the problem at 9.2 - this appears to be an issue with Proc Genmod. The SAS Macro Facility merely fetches the value for &syserr from the rest of the SAS System, where it's supposed to be set correctly by the data steps / procs.