BookmarkSubscribeRSS Feed
JuanVte
Calcite | Level 5
Dear all,

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:

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.
[...]

************************************************

data sim_data;
call streaminit(17427);
do k = 1 to 200;
x = 'pl';
y = rand('NEGBINOMIAL', 0.80, 1);
output;
end;
do k = 1 to 200;
x = 'tx';
y = rand('NEGBINOMIAL', 0.85, 1);
output;
end;
run;

proc genmod data=sim_data;
class x (param=ref ref='pl');
model y = x / dist=NEGBIN ;
lsmeans x;
run;

%put &syserr;

Any idea??
5 REPLIES 5
data_null__
Jade | Level 19
Perhaps you could use SYSWARNINGTEXT automatic variable.

[pre]
AUTOMATIC SYSWARNINGTEXT The procedure is continuing but the validity of the model fit is questionable
[/pre]
JuanVte
Calcite | Level 5
Thanks for your help!

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.

Try this just after my syntax above:

data _null_;
set _null_;
run;

%put &syserr &SYSWARNINGTEXT ;
data_null__
Jade | Level 19
The concergence status output has the relevant information.

[pre]
Output Added:
-------------
Name: ConvergenceStatus
Label: Convergence Status
Template: Stat.Genmod.ConvergenceStatus
Path: Genmod.ConvergenceStatus
-------------
[/pre]
JuanVte
Calcite | Level 5
Thanks!

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.

Thanks for your help!!
Juanvte.
PatrickG
SAS Employee
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.

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
  • 5 replies
  • 3026 views
  • 0 likes
  • 3 in conversation