Help using Base SAS procedures

Help on Error on Interactivity disabled due with by processing

Reply
Occasional Contributor
Posts: 12

Help on Error on Interactivity disabled due with by processing

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..
PROC Star
Posts: 7,417

Re: Help on Error on Interactivity disabled due with by processing

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
Super User
Posts: 3,181

Re: Help on Error on Interactivity disabled due with by processing

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.
SAS Super FREQ
Posts: 8,781

Re: Help on Error on Interactivity disabled due with by processing

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
Occasional Contributor
Posts: 12

Re: Help on Error on Interactivity disabled due with by processing

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

Smiley Happy
Ask a Question
Discussion stats
  • 4 replies
  • 2147 views
  • 0 likes
  • 4 in conversation