From: stats analysis on
Hi All,

I am trying to run the following macro which is taken from one of the
SAS SUG. I am getting some errors though (which I have pasted below
the code). One of them is that libname diction is not assigned. I
tried using my own libname but that didn't work. Any idea of what the
from statement is referring to? any help would be greatly appreciated.
Thanks!!

Options Mprint SYMBOLGEN MLOGIC;
%MACRO SCORE;

proc sql noprint;
select (nobs-delobs) into:num
from diction.tables
where libname='work'
and memname="Best_SUBSETS";
%let num=#
quit;

%do i=1 %to #

data_null_;
set Best_SUBSETS;
if _N_=&i;
call symput ('list', VariablesInModel);
run;

proc phreg data= mydata;
model eventnscf1=&list;
run;
%end;
%mend;
%score;

--------------------------------------------------------------------------------------
These are the errors:

ERROR: Libname DICTION is not assigned.
MLOGIC(SCORE): %LET (variable name is NUM)
WARNING: Apparent symbolic reference NUM not resolved.
ERROR: The text expression &NUM contains a recursive reference to the
macro variable NUM. The
macro variable will be assigned the null value.
MPRINT(SCORE): quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

SYMBOLGEN: Macro variable NUM resolves to
ERROR: %EVAL function has no expression to evaluate, or %IF statement
has no condition.
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro SCORE will stop executing.
MLOGIC(SCORE): Ending execution.
From: Reeza on
On Jul 26, 3:56 pm, stats analysis <statsfor...(a)gmail.com> wrote:
> Hi All,
>
> I am trying to run the following macro which is taken from one of the
> SAS SUG. I am getting some errors though (which I have pasted below
> the code). One of them is that libname diction is not assigned. I
> tried using my own libname but that didn't work. Any idea of what the
> from statement is referring to? any help would be greatly appreciated.
> Thanks!!
>
> Options Mprint SYMBOLGEN MLOGIC;
> %MACRO SCORE;
>
> proc sql noprint;
> select (nobs-delobs) into:num
> from diction.tables
> where libname='work'
> and memname="Best_SUBSETS";
> %let num=&num;
> quit;
>
> %do i=1 %to &num;
>
> data_null_;
> set Best_SUBSETS;
> if _N_=&i;
> call symput ('list', VariablesInModel);
> run;
>
> proc phreg data= mydata;
> model eventnscf1=&list;
> run;
> %end;
> %mend;
> %score;
>
> ---------------------------------------------------------------------------­-----------
> These are the errors:
>
> ERROR: Libname DICTION is not assigned.
> MLOGIC(SCORE):  %LET (variable name is NUM)
> WARNING: Apparent symbolic reference NUM not resolved.
> ERROR: The text expression &NUM contains a recursive reference to the
> macro variable NUM.  The
>        macro variable will be assigned the null value.
> MPRINT(SCORE):   quit;
> NOTE: The SAS System stopped processing this step because of errors.
> NOTE: PROCEDURE SQL used (Total process time):
>       real time           0.00 seconds
>       cpu time            0.00 seconds
>
> SYMBOLGEN:  Macro variable NUM resolves to
> ERROR: %EVAL function has no expression to evaluate, or %IF statement
> has no condition.
> ERROR: The %TO value of the %DO I loop is invalid.
> ERROR: The macro SCORE will stop executing.
> MLOGIC(SCORE):  Ending execution.

My guess is its hitting sashelp.vtables

The macro assumes that you already have the data set created called
"Best_SUBSETS".

May help if you post a link the actual document.

HTH,
Reeza
From: Lou on

"stats analysis" <statsforsas(a)gmail.com> wrote in message
news:1c2c4db0-6e87-4913-b52b-83b1a1ce8732(a)w12g2000yqj.googlegroups.com...
> Hi All,
>
> I am trying to run the following macro which is taken from one of the
> SAS SUG. I am getting some errors though (which I have pasted below
> the code). One of them is that libname diction is not assigned. I
> tried using my own libname but that didn't work. Any idea of what the
> from statement is referring to? any help would be greatly appreciated.
> Thanks!!
>
> Options Mprint SYMBOLGEN MLOGIC;
> %MACRO SCORE;
>
> proc sql noprint;
> select (nobs-delobs) into:num
> from diction.tables
> where libname='work'
> and memname="Best_SUBSETS";
> %let num=&num;
> quit;
>
> %do i=1 %to &num;
>
> data_null_;
> set Best_SUBSETS;
> if _N_=&i;
> call symput ('list', VariablesInModel);
> run;
>
> proc phreg data= mydata;
> model eventnscf1=&list;
> run;
> %end;
> %mend;
> %score;
>
> --------------------------------------------------------------------------
------------
> These are the errors:
>
> ERROR: Libname DICTION is not assigned.
> MLOGIC(SCORE): %LET (variable name is NUM)
> WARNING: Apparent symbolic reference NUM not resolved.
> ERROR: The text expression &NUM contains a recursive reference to the
> macro variable NUM. The
> macro variable will be assigned the null value.
> MPRINT(SCORE): quit;
> NOTE: The SAS System stopped processing this step because of errors.
> NOTE: PROCEDURE SQL used (Total process time):
> real time 0.00 seconds
> cpu time 0.00 seconds
>
> SYMBOLGEN: Macro variable NUM resolves to
> ERROR: %EVAL function has no expression to evaluate, or %IF statement
> has no condition.
> ERROR: The %TO value of the %DO I loop is invalid.
> ERROR: The macro SCORE will stop executing.
> MLOGIC(SCORE): Ending execution.

Instead of DICTION, it probably should say:

FROM DICTIONARY.TABLES

At least, the SQL code will run without issuing an error message. Without
seeing the paper, what's supposed to be in dataset BEST_SUBSETS is anybody's
guess.


From: Arthur Tabachneck on
Lou,

Since the code apparently comes from this paper:
http://www2.sas.com/proceedings/sugi30/206-30.pdf

I'd say you were right on.

Art
---------------
On Jul 26, 7:51 pm, "Lou" <lpog...(a)hotmail.com> wrote:
> "stats analysis" <statsfor...(a)gmail.com> wrote in message
>
> news:1c2c4db0-6e87-4913-b52b-83b1a1ce8732(a)w12g2000yqj.googlegroups.com...
>
>
>
>
>
> > Hi All,
>
> > I am trying to run the following macro which is taken from one of the
> > SAS SUG. I am getting some errors though (which I have pasted below
> > the code). One of them is that libname diction is not assigned. I
> > tried using my own libname but that didn't work. Any idea of what the
> > from statement is referring to? any help would be greatly appreciated.
> > Thanks!!
>
> > Options Mprint SYMBOLGEN MLOGIC;
> > %MACRO SCORE;
>
> > proc sql noprint;
> > select (nobs-delobs) into:num
> > from diction.tables
> > where libname='work'
> > and memname="Best_SUBSETS";
> > %let num=&num;
> > quit;
>
> > %do i=1 %to &num;
>
> > data_null_;
> > set Best_SUBSETS;
> > if _N_=&i;
> > call symput ('list', VariablesInModel);
> > run;
>
> > proc phreg data= mydata;
> > model eventnscf1=&list;
> > run;
> > %end;
> > %mend;
> > %score;
>
> > --------------------------------------------------------------------------
> ------------
> > These are the errors:
>
> > ERROR: Libname DICTION is not assigned.
> > MLOGIC(SCORE):  %LET (variable name is NUM)
> > WARNING: Apparent symbolic reference NUM not resolved.
> > ERROR: The text expression &NUM contains a recursive reference to the
> > macro variable NUM.  The
> >        macro variable will be assigned the null value.
> > MPRINT(SCORE):   quit;
> > NOTE: The SAS System stopped processing this step because of errors.
> > NOTE: PROCEDURE SQL used (Total process time):
> >       real time           0.00 seconds
> >       cpu time            0.00 seconds
>
> > SYMBOLGEN:  Macro variable NUM resolves to
> > ERROR: %EVAL function has no expression to evaluate, or %IF statement
> > has no condition.
> > ERROR: The %TO value of the %DO I loop is invalid.
> > ERROR: The macro SCORE will stop executing.
> > MLOGIC(SCORE):  Ending execution.
>
> Instead of DICTION, it probably should say:
>
> FROM DICTIONARY.TABLES
>
> At least, the SQL code will run without issuing an error message.  Without
> seeing the paper, what's supposed to be in dataset BEST_SUBSETS is anybody's
> guess.- Hide quoted text -
>
> - Show quoted text -

From: stats analysis on
On Jul 26, 10:13 pm, Arthur Tabachneck <art...(a)netscape.net> wrote:
> Lou,
>
> Since the code apparently comes from this paper:http://www2.sas.com/proceedings/sugi30/206-30.pdf
>
> I'd say you were right on.
>
> Art
> ---------------
> On Jul 26, 7:51 pm, "Lou" <lpog...(a)hotmail.com> wrote:
>
>
>
> > "stats analysis" <statsfor...(a)gmail.com> wrote in message
>
> >news:1c2c4db0-6e87-4913-b52b-83b1a1ce8732(a)w12g2000yqj.googlegroups.com....
>
> > > Hi All,
>
> > > I am trying to run the following macro which is taken from one of the
> > > SAS SUG. I am getting some errors though (which I have pasted below
> > > the code). One of them is that libname diction is not assigned. I
> > > tried using my own libname but that didn't work. Any idea of what the
> > > from statement is referring to? any help would be greatly appreciated..
> > > Thanks!!
>
> > > Options Mprint SYMBOLGEN MLOGIC;
> > > %MACRO SCORE;
>
> > > proc sql noprint;
> > > select (nobs-delobs) into:num
> > > from diction.tables
> > > where libname='work'
> > > and memname="Best_SUBSETS";
> > > %let num=&num;
> > > quit;
>
> > > %do i=1 %to &num;
>
> > > data_null_;
> > > set Best_SUBSETS;
> > > if _N_=&i;
> > > call symput ('list', VariablesInModel);
> > > run;
>
> > > proc phreg data= mydata;
> > > model eventnscf1=&list;
> > > run;
> > > %end;
> > > %mend;
> > > %score;
>
> > > --------------------------------------------------------------------------
> > ------------
> > > These are the errors:
>
> > > ERROR: Libname DICTION is not assigned.
> > > MLOGIC(SCORE):  %LET (variable name is NUM)
> > > WARNING: Apparent symbolic reference NUM not resolved.
> > > ERROR: The text expression &NUM contains a recursive reference to the
> > > macro variable NUM.  The
> > >        macro variable will be assigned the null value.
> > > MPRINT(SCORE):   quit;
> > > NOTE: The SAS System stopped processing this step because of errors.
> > > NOTE: PROCEDURE SQL used (Total process time):
> > >       real time           0.00 seconds
> > >       cpu time            0.00 seconds
>
> > > SYMBOLGEN:  Macro variable NUM resolves to
> > > ERROR: %EVAL function has no expression to evaluate, or %IF statement
> > > has no condition.
> > > ERROR: The %TO value of the %DO I loop is invalid.
> > > ERROR: The macro SCORE will stop executing.
> > > MLOGIC(SCORE):  Ending execution.
>
> > Instead of DICTION, it probably should say:
>
> > FROM DICTIONARY.TABLES
>
> > At least, the SQL code will run without issuing an error message.  Without
> > seeing the paper, what's supposed to be in dataset BEST_SUBSETS is anybody's
> > guess.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Thank you all for your response.
I created the Best_Subsets dataset which includes scores as mentioned
in the paper. I was first getting that dictionary.tables is long so I
cut it to diction. I put it back to dictionary now. and this is the
set of errors I get. I am not sure how to resolve the &num error. it
is the symbol "and" as mentioned in the paper.

ERROR: The text expression &NUM contains a recursive reference to the
macro variable NUM. The
macro variable will be assigned the null value.
MPRINT(SCORE): quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

SYMBOLGEN: Macro variable NUM resolves to
ERROR: %EVAL function has no expression to evaluate, or %IF statement
has no condition.
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro SCORE will stop executing.
MLOGIC(SCORE): Ending execution.

thanks

 |  Next  |  Last
Pages: 1 2
Prev: How to import a .xlsx file over 256 columns?
Next: HII