BookmarkSubscribeRSS Feed
e3flator
Calcite | Level 5

Hi,

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


29
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.
37
38       %put &syserr &syserrtext;
WARNING: Apparent symbolic reference SYSERRTEXT not resolved.
0 &syserrtext

Thank you very much

Federica

2 REPLIES 2
PGStats
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.

PG

PG
jobse
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!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1478 views
  • 0 likes
  • 3 in conversation