All:
i am using the simple code here . and i getiing an errror in the log .
i was expecting outvar to be resolved to agemax.. it does .. but NOT
in the datastep test1..
Any suggestions ...
options mlogic symbolgen;
%macro calc(invar = , outvar= );
proc sql;
create table test as
select name,sex,max(&invar) as &outvar
from sashelp.class
order by sex;
quit;
ods trace on ;
Ods output summary=means1 ;
proc means data = test median mean stderr clm ;
by sex;
var &outvar;
run;
ods listing close;
data test1;
set means1;
LL = &outvar_mean - 1.96* &outvar_STDERR;
UL = &outvar_mean + 1.96* &outvar_STDERR;
run;
%mend;
%calc(invar = age , outvar = agemax);
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
recovery of the LINE and COLUMN
where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a
quoted string,
a numeric constant, a datetime constant, a missing
value, INPUT, PUT.
WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
recovery of the LINE and COLUMN
where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a
quoted string,
a numeric constant, a datetime constant, a missing
value, INPUT, PUT.
WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
recovery of the LINE and COLUMN
where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a
quoted string,
a numeric constant, a datetime constant, a missing
value, INPUT, PUT.
WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
recovery of the LINE and COLUMN
where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a
quoted string,
a numeric constant, a datetime constant, a missing
value, INPUT, PUT.
WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
|
|
0
|
|
|
|
Reply
|
Al
|
3/23/2011 9:26:50 PM |
|
On Mar 23, 2:26=A0pm, Al <ali6...@gmail.com> wrote:
> All:
>
> i am using the simple code here . and i getiing an errror in the log .
> i was expecting outvar to be resolved to agemax.. it does .. but NOT
> in the datastep test1..
>
> Any suggestions ...
>
> options mlogic symbolgen;
> %macro calc(invar =3D , outvar=3D );
> proc sql;
> =A0 create table test as
> =A0 select name,sex,max(&invar) as &outvar
> =A0 from sashelp.class
> =A0 order by sex;
> quit;
> ods trace on ;
> Ods output summary=3Dmeans1 ;
>
> proc means data =3D test median mean stderr clm ;
> =A0 by sex;
> =A0 var &outvar;
> run;
> ods listing close;
> =A0data test1;
> =A0 =A0 set means1;
> =A0 =A0LL =3D &outvar_mean - 1.96* =A0&outvar_STDERR;
> =A0 =A0UL =3D &outvar_mean + 1.96* =A0&outvar_STDERR;
> run;
> %mend;
>
> %calc(invar =3D age , outvar =3D agemax);
>
> 22: LINE and COLUMN cannot be determined.
> NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> recovery of the LINE and COLUMN
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> ERROR 22-322: Syntax error, expecting one of the following: a name, a
> quoted string,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a mi=
ssing
> value, INPUT, PUT.
> WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> 22: LINE and COLUMN cannot be determined.
> NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> recovery of the LINE and COLUMN
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> ERROR 22-322: Syntax error, expecting one of the following: a name, a
> quoted string,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a mi=
ssing
> value, INPUT, PUT.
> WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
> 22: LINE and COLUMN cannot be determined.
> NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> recovery of the LINE and COLUMN
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> ERROR 22-322: Syntax error, expecting one of the following: a name, a
> quoted string,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a mi=
ssing
> value, INPUT, PUT.
> WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> 22: LINE and COLUMN cannot be determined.
> NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> recovery of the LINE and COLUMN
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> ERROR 22-322: Syntax error, expecting one of the following: a name, a
> quoted string,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a mi=
ssing
> value, INPUT, PUT.
> WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
Remove the ods listing close and the trace lines you probably don't
need those in macro code and I think that's causing some of the
errors.
&outvar_mean and &outvar_max are not macro variables which is how
you're referring to them.
You can tell sas to resolve the &outvar macro variable with a period
after it
ie &outvar._mean
HTH,
Reeza
|
|
0
|
|
|
|
Reply
|
Reeza
|
3/23/2011 10:34:47 PM
|
|
On Mar 23, 5:34=A0pm, Reeza <fkhurs...@hotmail.com> wrote:
> On Mar 23, 2:26=A0pm, Al <ali6...@gmail.com> wrote:
>
>
>
>
>
> > All:
>
> > i am using the simple code here . and i getiing an errror in the log .
> > i was expecting outvar to be resolved to agemax.. it does .. but NOT
> > in the datastep test1..
>
> > Any suggestions ...
>
> > options mlogic symbolgen;
> > %macro calc(invar =3D , outvar=3D );
> > proc sql;
> > =A0 create table test as
> > =A0 select name,sex,max(&invar) as &outvar
> > =A0 from sashelp.class
> > =A0 order by sex;
> > quit;
> > ods trace on ;
> > Ods output summary=3Dmeans1 ;
>
> > proc means data =3D test median mean stderr clm ;
> > =A0 by sex;
> > =A0 var &outvar;
> > run;
> > ods listing close;
> > =A0data test1;
> > =A0 =A0 set means1;
> > =A0 =A0LL =3D &outvar_mean - 1.96* =A0&outvar_STDERR;
> > =A0 =A0UL =3D &outvar_mean + 1.96* =A0&outvar_STDERR;
> > run;
> > %mend;
>
> > %calc(invar =3D age , outvar =3D agemax);
>
> > 22: LINE and COLUMN cannot be determined.
> > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > recovery of the LINE and COLUMN
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > quoted string,
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a =
missing
> > value, INPUT, PUT.
> > WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> > 22: LINE and COLUMN cannot be determined.
> > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > recovery of the LINE and COLUMN
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > quoted string,
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a =
missing
> > value, INPUT, PUT.
> > WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
> > 22: LINE and COLUMN cannot be determined.
> > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > recovery of the LINE and COLUMN
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > quoted string,
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a =
missing
> > value, INPUT, PUT.
> > WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> > 22: LINE and COLUMN cannot be determined.
> > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > recovery of the LINE and COLUMN
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > quoted string,
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, a =
missing
> > value, INPUT, PUT.
> > WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
>
> Remove the ods listing close and the trace lines you probably don't
> need those in macro code and I think that's causing some of the
> errors.
>
> &outvar_mean and &outvar_max are not macro variables which is how
> you're referring to them.
>
> You can tell sas to resolve the &outvar macro variable with a period
> after it
>
> ie &outvar._mean
>
> HTH,
> Reeza- Hide quoted text -
>
> - Show quoted text -
&outvar._mean resolved the issue...
Thanks for your help
|
|
0
|
|
|
|
Reply
|
Al
|
3/23/2011 10:58:11 PM
|
|
On Mar 23, 5:58=A0pm, Al <ali6...@gmail.com> wrote:
> On Mar 23, 5:34=A0pm, Reeza <fkhurs...@hotmail.com> wrote:
>
>
>
>
>
> > On Mar 23, 2:26=A0pm, Al <ali6...@gmail.com> wrote:
>
> > > All:
>
> > > i am using the simple code here . and i getiing an errror in the log =
..
> > > i was expecting outvar to be resolved to agemax.. it does .. but NOT
> > > in the datastep test1..
>
> > > Any suggestions ...
>
> > > options mlogic symbolgen;
> > > %macro calc(invar =3D , outvar=3D );
> > > proc sql;
> > > =A0 create table test as
> > > =A0 select name,sex,max(&invar) as &outvar
> > > =A0 from sashelp.class
> > > =A0 order by sex;
> > > quit;
> > > ods trace on ;
> > > Ods output summary=3Dmeans1 ;
>
> > > proc means data =3D test median mean stderr clm ;
> > > =A0 by sex;
> > > =A0 var &outvar;
> > > run;
> > > ods listing close;
> > > =A0data test1;
> > > =A0 =A0 set means1;
> > > =A0 =A0LL =3D &outvar_mean - 1.96* =A0&outvar_STDERR;
> > > =A0 =A0UL =3D &outvar_mean + 1.96* =A0&outvar_STDERR;
> > > run;
> > > %mend;
>
> > > %calc(invar =3D age , outvar =3D agemax);
>
> > > 22: LINE and COLUMN cannot be determined.
> > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > recovery of the LINE and COLUMN
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > > quoted string,
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, =
a missing
> > > value, INPUT, PUT.
> > > WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> > > 22: LINE and COLUMN cannot be determined.
> > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > recovery of the LINE and COLUMN
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > > quoted string,
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, =
a missing
> > > value, INPUT, PUT.
> > > WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
> > > 22: LINE and COLUMN cannot be determined.
> > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > recovery of the LINE and COLUMN
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > > quoted string,
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, =
a missing
> > > value, INPUT, PUT.
> > > WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> > > 22: LINE and COLUMN cannot be determined.
> > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > recovery of the LINE and COLUMN
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > ERROR 22-322: Syntax error, expecting one of the following: a name, a
> > > quoted string,
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant, =
a missing
> > > value, INPUT, PUT.
> > > WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
>
> > Remove the ods listing close and the trace lines you probably don't
> > need those in macro code and I think that's causing some of the
> > errors.
>
> > &outvar_mean and &outvar_max are not macro variables which is how
> > you're referring to them.
>
> > You can tell sas to resolve the &outvar macro variable with a period
> > after it
>
> > ie &outvar._mean
>
> > HTH,
> > Reeza- Hide quoted text -
>
> > - Show quoted text -
>
> &outvar._mean =A0resolved the issue...
>
> Thanks for your help- Hide quoted text -
>
> - Show quoted text -
i am trying to this macro variable in proc gplot and the proc does
NOT recognize it .. any suggestions ???
proc gplot data =3D inputdata
plot &outvar._mean*sex =3D weight ;
run;
|
|
0
|
|
|
|
Reply
|
Al
|
3/23/2011 11:49:25 PM
|
|
On Mar 23, 4:49=A0pm, Al <ali6...@gmail.com> wrote:
> On Mar 23, 5:58=A0pm, Al <ali6...@gmail.com> wrote:
>
>
>
>
>
> > On Mar 23, 5:34=A0pm, Reeza <fkhurs...@hotmail.com> wrote:
>
> > > On Mar 23, 2:26=A0pm, Al <ali6...@gmail.com> wrote:
>
> > > > All:
>
> > > > i am using the simple code here . and i getiing an errror in the lo=
g .
> > > > i was expecting outvar to be resolved to agemax.. it does .. but NO=
T
> > > > in the datastep test1..
>
> > > > Any suggestions ...
>
> > > > options mlogic symbolgen;
> > > > %macro calc(invar =3D , outvar=3D );
> > > > proc sql;
> > > > =A0 create table test as
> > > > =A0 select name,sex,max(&invar) as &outvar
> > > > =A0 from sashelp.class
> > > > =A0 order by sex;
> > > > quit;
> > > > ods trace on ;
> > > > Ods output summary=3Dmeans1 ;
>
> > > > proc means data =3D test median mean stderr clm ;
> > > > =A0 by sex;
> > > > =A0 var &outvar;
> > > > run;
> > > > ods listing close;
> > > > =A0data test1;
> > > > =A0 =A0 set means1;
> > > > =A0 =A0LL =3D &outvar_mean - 1.96* =A0&outvar_STDERR;
> > > > =A0 =A0UL =3D &outvar_mean + 1.96* =A0&outvar_STDERR;
> > > > run;
> > > > %mend;
>
> > > > %calc(invar =3D age , outvar =3D agemax);
>
> > > > 22: LINE and COLUMN cannot be determined.
> > > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > > recovery of the LINE and COLUMN
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > > ERROR 22-322: Syntax error, expecting one of the following: a name,=
a
> > > > quoted string,
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant=
, a missing
> > > > value, INPUT, PUT.
> > > > WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> > > > 22: LINE and COLUMN cannot be determined.
> > > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > > recovery of the LINE and COLUMN
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > > ERROR 22-322: Syntax error, expecting one of the following: a name,=
a
> > > > quoted string,
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant=
, a missing
> > > > value, INPUT, PUT.
> > > > WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
> > > > 22: LINE and COLUMN cannot be determined.
> > > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > > recovery of the LINE and COLUMN
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > > ERROR 22-322: Syntax error, expecting one of the following: a name,=
a
> > > > quoted string,
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant=
, a missing
> > > > value, INPUT, PUT.
> > > > WARNING: Apparent symbolic reference OUTVAR_MEAN not resolved.
> > > > 22: LINE and COLUMN cannot be determined.
> > > > NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow
> > > > recovery of the LINE and COLUMN
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 where the error has occurred.
> > > > ERROR 22-322: Syntax error, expecting one of the following: a name,=
a
> > > > quoted string,
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 a numeric constant, a datetime constant=
, a missing
> > > > value, INPUT, PUT.
> > > > WARNING: Apparent symbolic reference OUTVAR_STDERR not resolved.
>
> > > Remove the ods listing close and the trace lines you probably don't
> > > need those in macro code and I think that's causing some of the
> > > errors.
>
> > > &outvar_mean and &outvar_max are not macro variables which is how
> > > you're referring to them.
>
> > > You can tell sas to resolve the &outvar macro variable with a period
> > > after it
>
> > > ie &outvar._mean
>
> > > HTH,
> > > Reeza- Hide quoted text -
>
> > > - Show quoted text -
>
> > &outvar._mean =A0resolved the issue...
>
> > Thanks for your help- Hide quoted text -
>
> > - Show quoted text -
>
> i am trying to this macro variable in proc gplot =A0and the proc does
> NOT recognize it .. any suggestions ???
>
> proc gplot data =3D inputdata
> =A0 =A0 plot &outvar._mean*sex =3D weight ;
> run;- Hide quoted text -
>
> - Show quoted text -
missing a semicolon after the first line?
If not that, what's the error message?
|
|
0
|
|
|
|
Reply
|
Reeza
|
3/24/2011 12:06:25 AM
|
|
|
4 Replies
672 Views
(page loaded in 0.101 seconds)
Similiar Articles: Macro error - comp.soft-sys.sasAll: i am using the simple code here . and i getiing an errror in the log . i was expecting outvar to be resolved to agemax.. it does .. but NOT ... What is the option in Macro to display ERROR message if macro ...check for variable existence, if not there put variable in. - comp ... Hi Catima, SYMEXIST checks the existence of macro variables, not the existence of SAS ... Custom assertion macros - comp.lang.c++.moderatedDo you use the standard assertion header, or do you roll your own? Pros/cons? #include struct Assertion_error { Assertion_error(char co... User written macro or SAS supplied macro ?? - comp.soft-sys.sas ...Is this user written macro or SAS supplied macro ?? I am > getting error at %label too > > data anno1; > length text $ *14*; > %*system*(*3*,*3*,*3*); > if "&run_ib ... How to use macro variable in libname statatement. - comp.soft-sys ...What is the option in Macro to display ERROR message if macro ... If you are inside a macro then use it in a %IF or other conditional macro statement. ... Macro not resoved - comp.soft-sys.sasWhat is the option in Macro to display ERROR message if macro ... What is the option in Macro to display ERROR message if macro ... sas, What is the option in Macro to ... Evaluating Logical Variables in SAS Macro - comp.soft-sys.sas ...... STATE = "WA") +0.143413748*(GENDER = "M")); The equivalent works in Normal SAS code however when I bought it into Macro language (as I want to vary x) I got errors. macro stringize question - comp.lang.c++.moderatedConsider the following macro #define NOMEM(li) L"Out of memory line " #li The ... could) It compiles and works > fine with C++Builder5, but VisualC++2003 says "error ... Re: PROC DATASETS but only when no errors - comp.soft-sys.sas ...The error condition and message are inputs to the macro so each > program can decide what constitutes an error and how to explain that > error to the user. Getting the outcome of a system command into SAS macro variable ...Hi, You can set up a pipe in the macro language, not very elegant. I don't have SAS right now so this is from memory. There are probably many syntax errors. Macro Error - Support - Office.com - Microsoft Corporation ...Show All Hide All There is an error in the macro (macro: An action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for ... Macro Error - Excel - Office.com - Microsoft Corporation: Software ...Show All Hide All The Macro Error message appears when there is an error in the macro (macro: An action or a set of actions that you can use to automate tasks. Macros ... 7/23/2012 11:40:33 AM
|