<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711053#M34400</link>
    <description>&lt;P&gt;1. Yes, this can happen with G convergence. For possible reasons and references to more information, see &lt;A href="https://blogs.sas.com/content/iml/2019/04/03/g-matrix-is-not-positive-definite.html" target="_self"&gt;"Convergence in mixed models: When the estimated G matrix is not positive definite."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. In this part of a simulation study? You can monitor the convergence during a simulation study and exclude (or otherwise handle) samples that did not converge. For details, see &lt;A href="https://blogs.sas.com/content/iml/2015/08/26/convergence-sim.html" target="_self"&gt;"Monitor convergence during simulation studies in SAS."&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2021 12:24:35 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-01-13T12:24:35Z</dc:date>
    <item>
      <title>NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/710934#M34392</link>
      <description>&lt;P&gt;Dear SAS Comunity&lt;/P&gt;&lt;P&gt;Running some nonlinear models, sometimes happen to me that I can have a successful "convergence" message from SAS (Convergestatus table: F Conv), and at the same time&amp;nbsp; I can have in the Parameter Estimates: SE with infinity value and the message in the Log:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"The final Hessian matrix is full rank but has at least one negative eigenvalue. Second-order optimality condition violated."&lt;/P&gt;&lt;P&gt;I have 2 questions:&lt;/P&gt;&lt;P&gt;1) Could this behavior (Non-positive definite H matrix, and infinity SE) happen with a G-Convergence?&lt;/P&gt;&lt;P&gt;2) If the previous answer is YES (in the case of NO, the response to the following question is clear now). Is it possible to have the Hessian matrix status log message as a table output?&lt;/P&gt;&lt;P&gt;Thanks in advance!!!!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 22:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/710934#M34392</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-12T22:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711046#M34395</link>
      <description>&lt;P&gt;I would like to rewrite my question, maybe that could help that somebody help me:&lt;/P&gt;&lt;P&gt;I would like to ask how to avoid negative eigenvalues in the Hessian matrix (which as I understand is related to non maximum points or unstable estimation that cannot be trusted)&lt;/P&gt;&lt;P&gt;I mean, how to have in the automatic way when you are running a lot of models, that one of the models had a Hessian matrix with at least one negative eigenvalue.&lt;/P&gt;&lt;P&gt;Usually, the message is presented in the log area, but I'm aware to have it in a table output (as for example convergence status)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ptadgerv_1-1610538956214.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53449i8730CC9DD3AEE210/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ptadgerv_1-1610538956214.png" alt="ptadgerv_1-1610538956214.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 11:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711046#M34395</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T11:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711053#M34400</link>
      <description>&lt;P&gt;1. Yes, this can happen with G convergence. For possible reasons and references to more information, see &lt;A href="https://blogs.sas.com/content/iml/2019/04/03/g-matrix-is-not-positive-definite.html" target="_self"&gt;"Convergence in mixed models: When the estimated G matrix is not positive definite."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. In this part of a simulation study? You can monitor the convergence during a simulation study and exclude (or otherwise handle) samples that did not converge. For details, see &lt;A href="https://blogs.sas.com/content/iml/2015/08/26/convergence-sim.html" target="_self"&gt;"Monitor convergence during simulation studies in SAS."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 12:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711053#M34400</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-13T12:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711059#M34401</link>
      <description>&lt;P&gt;Thanks, Rick for your quick answer. I did read your articles, but I don't find an answer to my question.&lt;/P&gt;&lt;P&gt;My study is not a simulation study but is a study that requires to fit 30 models per data (again and again!), in different scenarios, which makes it almost impossible to check by hand the non-positive definite matrix log message. The models are nonlinear ones, so I'm using NLMIXED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For sure PROC MIXED (also GLIMMIX if I remember well) is very helpful with the ConvergeStatus&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ptadgerv_1-1610540906738.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53452iBB71752ED13F7C97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ptadgerv_1-1610540906738.png" alt="ptadgerv_1-1610540906738.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but the "same" table&amp;nbsp;ConvergenceStatus in NLMIXED, only says if you get convergence and which type (nothing about non-positive definite status, like PORC MIXED):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ptadgerv_2-1610540945786.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53453iC888F38D4E8B1220/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ptadgerv_2-1610540945786.png" alt="ptadgerv_2-1610540945786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but nothing about the positive definite matrix status :'(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 12:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711059#M34401</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T12:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711279#M34411</link>
      <description>&lt;P&gt;You are correct. I don't have a simple solution, but you could try something like this to monitor each model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro MonitorErrors(ModelID);
   data ErrorMsg;
      length msg $200;
      ModelID = &amp;amp;ModelID;&lt;BR /&gt;      SysErr = &amp;amp;syserr;
      %if &amp;amp;syserr = 4 %then %do;
         msg = "&amp;amp;syswarningtext";
      %end;
      %else %do;
         msg = "OK";
      %end;
   run;
   proc append base=Errors data=ErrorMsg force; run;
%mend;


proc datasets nolist; 
  delete Errors;   /* delete this data set if it exists */
run;

proc nlmixed;
   /* FIRST MODEL */
quit;
%MonitorErrors(1);

proc nlmixed;
   /* SECOND MODEL */
quit;
%MonitorErrors(2);

proc print data=Errors; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The basic idea is that if NLMIXED experiences a convergence issue, it will set the SYSERR macro to 4 and store the warning message in the SYSWARNINGTEXT macro. You can write the "model number" and the text to a data set and append each result to the one that comes before it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't tested the program, so it might need some tweaking. Actually, I've never done this before, so please let me know if it works!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 20:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711279#M34411</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-13T20:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711287#M34412</link>
      <description>&lt;P&gt;Thank you Rick!&lt;/P&gt;&lt;P&gt;It's a really good idea but doesn't capture the log message of the non-positive definite H matrix. In different situations (with and without error), the results is the same:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ptadgerv_0-1610572541594.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53481iAE2C5AEBAD8B7FDE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ptadgerv_0-1610572541594.png" alt="ptadgerv_0-1610572541594.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The other idea that I have is to check for an infinitive value in SD for Parm Estimates, or empty values in the variance-covariance matrix. Which almost I saw that appear at the same time with the non-positive definite behavior.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 21:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711287#M34412</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T21:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711288#M34413</link>
      <description>Fe errata:&lt;BR /&gt;Which almost appears at the same time as the non-positive definite H matrix behavior.</description>
      <pubDate>Wed, 13 Jan 2021 21:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711288#M34413</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T21:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711290#M34414</link>
      <description>&lt;P&gt;Please post data and some sample SAS code so that I can produce the kinds of errors you are seeing and look for a solution.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 21:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711290#M34414</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-13T21:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711300#M34415</link>
      <description>&lt;P&gt;data sham;&lt;BR /&gt;input confirmed 8. time 8.;&lt;BR /&gt;datalines;&lt;BR /&gt;38 1&lt;BR /&gt;72 2&lt;BR /&gt;125 3&lt;BR /&gt;206 4&lt;BR /&gt;316 5&lt;BR /&gt;343 6&lt;BR /&gt;407 7&lt;BR /&gt;501 8&lt;BR /&gt;600 9&lt;BR /&gt;774 10&lt;BR /&gt;1024 11&lt;BR /&gt;1362 12&lt;BR /&gt;1541 13&lt;BR /&gt;1755 14&lt;BR /&gt;2142 15&lt;BR /&gt;2564 16&lt;BR /&gt;3098 17&lt;BR /&gt;3811 18&lt;BR /&gt;4473 19&lt;BR /&gt;4942 20&lt;BR /&gt;5428 21&lt;BR /&gt;6756 22&lt;BR /&gt;7951 23&lt;BR /&gt;9150 24&lt;BR /&gt;10513 25&lt;BR /&gt;12031 26&lt;BR /&gt;12875 27&lt;BR /&gt;13558 28&lt;BR /&gt;15296 29&lt;BR /&gt;16977 30&lt;BR /&gt;18493 31&lt;BR /&gt;19971 32&lt;BR /&gt;21665 33&lt;BR /&gt;22587 34&lt;BR /&gt;23252 35&lt;BR /&gt;25186 36&lt;BR /&gt;26701 37&lt;BR /&gt;28299 38&lt;BR /&gt;30538 39&lt;BR /&gt;32874 40&lt;BR /&gt;33903 41&lt;BR /&gt;34427 42&lt;BR /&gt;34964 43&lt;BR /&gt;36524 44&lt;BR /&gt;38157 45&lt;BR /&gt;39831 46&lt;BR /&gt;41225 47&lt;BR /&gt;41947 48&lt;BR /&gt;42390 49&lt;BR /&gt;43666 50&lt;BR /&gt;44936 51&lt;BR /&gt;45713 52&lt;BR /&gt;46689 53&lt;BR /&gt;47500 54&lt;BR /&gt;47888 55&lt;BR /&gt;48093 56&lt;BR /&gt;48848 57&lt;BR /&gt;49417 58&lt;BR /&gt;49939 59&lt;BR /&gt;50525 60&lt;BR /&gt;50762 61&lt;BR /&gt;51048 62&lt;BR /&gt;51188 63&lt;BR /&gt;51858 64&lt;BR /&gt;52404 65&lt;BR /&gt;52956 66&lt;BR /&gt;53398 67&lt;BR /&gt;53881 68&lt;BR /&gt;54121 69&lt;BR /&gt;54239 70&lt;BR /&gt;54715 71&lt;BR /&gt;55110 72&lt;BR /&gt;55431 73&lt;BR /&gt;55736 74&lt;BR /&gt;56082 75&lt;BR /&gt;56229 76&lt;BR /&gt;56310 77&lt;BR /&gt;56627 78&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc nlmixed data=sham MAXITER=500;&lt;BR /&gt;parms s2=100000, maximo=500, alpha=57000 , etas=40;&lt;BR /&gt;mu = alpha/( (1+k*exp(-gamma*(time-eta)) ) **(1/k) );&lt;BR /&gt;model confirmed ~ normal(mu,s2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again thank you for your time and help&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 21:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711300#M34415</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711307#M34416</link>
      <description>&lt;P&gt;Dear Rick&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would provide a more simple example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This model converges and produces a positive definite H matrix:&lt;/P&gt;
&lt;PRE&gt;data pump;
input y t group;
pump = _n_;
logtstd = log(t) - 2.4564900;
datalines;
5 94.320 1
1 15.720 2
5 62.880 1
14 125.760 1
3 5.240 2
19 31.440 1
1 1.048 2
1 1.048 2
4 2.096 2
22 10.480 2
;

proc nlmixed data=pump;
parms logsig 0 1 /* multiple initial guesses for each parameter */
beta1 -1 to 1 by 0.5 
beta2 -1 to 1 by 0.5
alpha1 1 5 10
alpha2 1 5; /* use BEST=10 option to see top 10 choices */
if (group = 1) then eta = alpha1 + beta1*logtstd + e;
else eta = alpha2 + beta2*logtstd + e;
lambda = exp(eta);
model y ~ poisson(lambda);
random e ~ normal(0,exp(2*logsig)) subject=pump;
run;

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following model converges but produces a non-positive definite H matrix:&lt;/P&gt;
&lt;PRE&gt;data pump;
input y t group;
pump = _n_;
logtstd = log(t) - 2.4564900;
datalines;
5 94.320 1
1 15.720 1
5 62.880 1
14 125.760 1
3 5.240 1
19 31.440 1
1 1.048 1
1 1.048 1
4 2.096 1
22 10.480 2
;

proc nlmixed data=pump;
parms logsig 0 1 /* multiple initial guesses for each parameter */
beta1 1
beta2 2
alpha1 10
alpha2 1 5; /* use BEST=10 option to see top 10 choices */
if (group = 1) then eta = alpha1 + beta1*logtstd + e;
else eta = alpha2 + beta2*logtstd + e;
lambda = exp(eta);
model y ~ poisson(lambda);
random e ~ normal(0,exp(2*logsig)) subject=pump;
run;&lt;/PRE&gt;
&lt;P&gt;These two are my most common scenarios...&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 22:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711307#M34416</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T22:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711320#M34417</link>
      <description>&lt;P&gt;Dear Rick&lt;BR /&gt;I think that the problem with your previous code, it's that we need to delete the memory of the variable! (I don't know why is not possible to overwrite)&lt;BR /&gt;It's obvious that after each procedure these variables:&lt;/P&gt;
&lt;PRE&gt;%put &amp;amp;syserr;
%put &amp;amp;syswarningtext;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Capture perfectly what is happening in the log area.&lt;/P&gt;
&lt;P&gt;But the variable needs to be deleted to capture again the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, I tried it with this (between one nlmixed and the next one), and it works perfectly (but not inside your macro):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%macro deleteALL;
   	options nonotes;
  	%local vars;
  	proc sql noprint;
      	     select name into: vars separated by ' '
         	  from dictionary.macros
            	      where scope='GLOBAL' 
			   and not name contains 'SYS_SQL_IP_';
   	quit;
   	%symdel &amp;amp;vars;
   	options notes;
    	%put NOTE: Macro variables deleted.;
%mend deleteALL;&lt;BR /&gt;%deleteALL;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 23:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711320#M34417</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-13T23:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711411#M34418</link>
      <description>&lt;P&gt;Thanks for posting data and code. Very helpful. I think the following will work. Try it out.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro MonitorErrors(ModelID, ErrorNum, Text);
   data ErrorMsg;
      length msg $200;
      ModelID = &amp;amp;ModelID;
      SysErr = &amp;amp;ErrorNum;
      %if &amp;amp;ErrorNum = 0 %then %do;
         msg = "OK";
      %end;
      %else %do;
         msg = &amp;amp;Text;
      %end;
   run;
   proc append base=Errors data=ErrorMsg force; run;
%mend;

proc datasets nolist; 
  delete Errors;   /* delete this data set if it exists */
run;

proc nlmixed ;
/* first model */
run;
%MonitorErrors(1, &amp;amp;SysErr, "&amp;amp;SysWarningText");

proc nlmixed;
/* second model */
run;
%MonitorErrors(2, &amp;amp;SysErr, "&amp;amp;SysWarningText");

proc print data=Errors; run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jan 2021 10:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711411#M34418</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-14T10:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711415#M34419</link>
      <description>&lt;P&gt;Thank you Rick for such an important and necessary approach in nlmixed!.&amp;nbsp;&lt;BR /&gt;If you ask me, this has to be the default behavior of statusconverge table in nlmixed, to inform about the non-positive definite H matrix (as MIXED and GLIMMIX does).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 11:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/711415#M34419</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-14T11:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/712237#M34437</link>
      <description>&lt;P&gt;Dear Rick&lt;/P&gt;
&lt;P&gt;Is it possible to adapt your macro into a proc nlmixed with the "by statement"? I tried, but the macro didn't record all the log messages, just the last one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 21:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/712237#M34437</guid>
      <dc:creator>ptadgerv</dc:creator>
      <dc:date>2021-01-18T21:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED: difference between convergence status and non-positive Hessian  matrix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/712379#M34438</link>
      <description>&lt;P&gt;No, SYSERR only returns the results from the last BY group, I believe. That is why I use the&amp;nbsp;&lt;SPAN&gt;ConvergenceStatus&amp;nbsp;table to monitor convergence in simulation studies.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 11:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-difference-between-convergence-status-and-non-positive/m-p/712379#M34438</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-19T11:20:28Z</dc:date>
    </item>
  </channel>
</rss>

