Date: Thu, 20 Oct 2011 11:05:35 -0700
Reply-To: Shell Bell <cherryhill@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Shell Bell <cherryhill@HOTMAIL.COM>
Subject: Proc SQL How to create a constant from resolving macro
Content-Type: text/plain; charset="iso-8859-1"
I wanted to get the value of the macro var &&dataset_&j into a var IncomingDS.
These didn't work:
proc sql ;
create table &&dataset_&j as
select &&dataset_&j as IncomingDS
,count(*) as NumRecs
from &lib..&&dataset_&j;
quit;
proc sql ;
create table &&dataset_&j as
select "&&dataset_&j" as IncomingDS
,count(*) as NumRecs
from &lib..&&dataset_&j;
quit;
proc sql ;
create table &&dataset_&j as
select ""&&dataset_&j"" as IncomingDS
,count(*) as NumRecs
from &lib..&&dataset_&j;
quit;
This last got:
ERROR: Invalid date/time/datetime constant ""D.
Thanks in advance,
ShellBell |