Programming the statistical procedures from SAS

Proc model error dealing

Occasional Contributor
Posts: 5

Proc model error dealing


I've problem in intercepting errors in proc model. Is there a macro variable that I can use to do it? I've tried with &syserr but with no siìuccess.

Here is an example:

22      data test;
23         do i = 1 to 20;
24            x = 5 * ranuni(1234);
25            y = 10 + 2 * sqrt(x) + .5 * rannor(2345);
26            output;
27            end;
28       run;

NOTE: The data set WORK.TEST has 20 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.00 seconds

30       proc model data=test;
31          y = a + b * x ** c;
32          label a = "Intercept"
33                b = "Coefficient of Transformed X"
34                c = "Power Transformation Parameter";

35          fit y;
36       run;

NOTE: The iteration limit is exceeded for OLS.
ERROR: The parameter estimates failed to converge for OLS after 100 iterations using
       CONVERGE=0.001 as the convergence criteria.
38       %put &syserr &syserrtext;
WARNING: Apparent symbolic reference SYSERRTEXT not resolved.
0 &syserrtext

Thank you very much


Respected Advisor
Posts: 5,056

Re: Proc model error dealing

Found in the doc :

PROC MODEL stores a return code in the automatic macro variable SYSINFO upon
completion of the PROC MODEL step. In the event any FIT or SOLVE task fails to
converge during the completion of a PROC MODEL step the value 1 is stored in the
SYSINFO macro variable. Any subsequent SAS step will reset the value of SYSINFO.


Posts: 1

Re: Proc model error dealing

Hi Federica,

The problem is that SYSINFO is set "on completion of a PROC MODEL step". That's why it's adviced to use:

proc model data=test;

      y = a + b * x ** c;

      label a = "Intercept"

            b = "Coefficient of Transformed X"

            c = "Power Transformation Parameter";

      fit y;

quit; /* This is the missing statement */

%put SYSINFO=&sysinfo;

Now it works!

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation