BookmarkSubscribeRSS Feed
rockerd
Fluorite | Level 6
Hi all,

I am running regression model which works :

proc reg data = abc;
model &dep = &indep;
by &commented;
run;

However, when I am trying to add option of producing standardized coeff. I am getting following error message. ..

proc reg data = abc;
model &dep = &indep /stb;
by &commented;
run;


NOTE: The previous statement has been deleted.
SYMBOLGEN: Macro variable COMMENTED resolves to by Global_Segment
MPRINT(REGRESS): /stb by Global_Segment ;
MPRINT(REGRESS): RUN;
NOTE: Line generated by the invoked macro "REGRESS".
189 model &dep = &indep /stb; &commented ; RUN;
_
180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Interactivity disabled with BY processing.
NOTE: PROCEDURE REG used (Total process time):
real time 0.13 seconds
cpu time 0.12 seconds



Is there any way to work around this problem?

Thank you..
4 REPLIES 4
art297
Opal | Level 21
Your code works fine on my computer (sas 9.1.3 m3 on windows 2003 server).

You probably would be better off ending proc reg with a quit statement rather than a run statement and if wouldn't hurt if you ended all of your macro variables with periods. Like:

data abc;
set sashelp.class;
run;

proc sort data=abc;
by sex;
run;

%let dep=height;
%let indep=age;
%let commented=sex;

proc reg data = abc;
model &dep. = &indep.;
by &commented.;
quit;

proc reg data = abc;
model &dep. = &indep. /stb;
by &commented.;
quit;

Other than that, I can only guess that your macro variables were only declared as "local" for the first run.

Art
SASKiwi
PROC Star
It would be helpful if you could supply the full code including your macro definition statements and macro call statement. The MPRINT evidence is suggesting that &commented may contain the text BY as well as the BY variable. If it is this should be removed.

Supplying the full code would help clarify this.
Cynthia_sas
SAS Super FREQ
Hi:
There's a difference between the code you posted and the code that was discussed in this forum posting:
http://support.sas.com/forums/message.jspa?messageID=42310#42310

The "interactivity disabled" note just means that you were being warned that interactive mode (for PROC REG) was no longer in effect. (Also you did not correctly end the PROC REG step with a QUIT statement for batch processing.) As this Tech Support note says:
http://support.sas.com/kb/37/105.html


The ANOVA, ARIMA, CATMOD, FACTEX, GLM, MODEL, OPTEX, PLAN, and REG procedures are interactive procedures. They remain active after processing a RUN statement. The "running" message in the banner of the program editor window alerts you to the fact that these procedures are still active. More statements can be submitted as a continuation of the previous statements. A new group of statements can be executed by submitting them along with a RUN statement. These procedures remain active until a DATA step or another procedure is executed, or if a QUIT statement is submitted. In many cases, interactivity is disabled when a BY statement is specified.


I doubt that the "interactivity disabled" was the cause of the problem with your macro program. At this point, seeing your whole macro program (what's between the %MACRO and %MEND) will be most useful and then showing how you're invoking the macro program that you've defined will also be useful. At this point, a verbal description of the your ultimate goal and what you think the macro is doing would also be helpful.

cynthia
rockerd
Fluorite | Level 6
Thank you Cynthia, SASKiwi and Art ..

I was finally able to figure out the error was in the macro variables default value which I accidently stored as

"indep = x1 x2 x3; "

because of the extra " ; " I was getting the error. After spending hours on trying different codes I found this .. That was very frustrating ;(

Thank you all guys for your help

:)

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 5010 views
  • 0 likes
  • 4 in conversation