BookmarkSubscribeRSS Feed
Calcite | Level 5


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


Opal | Level 21

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.


Calcite | Level 5

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!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 3 in conversation