Date: Thu, 11 Sep 2008 12:57:44 -0400
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: filtering according to a date
you can also use
%let actdate = "31dec1981"d;
....
and b.date = &actdate;
if you want to.
Avoid using ... '&actdate'd ....
In single quotes the macro variables are not resolved!
Gerhard
On Thu, 11 Sep 2008 09:25:34 -0700, Terjeson, Mark <Mterjeson@RUSSELL.COM>
wrote:
>Hi Heena,
>
>The macro variable can be referenced with
>a preceeding ampersand character. i.e. &actdate
>
>
>%let actdate=31Dec1981;
>
>proc sql;
> create table temp as
> select a.* from name a, dateofbirth b
> where a.name = b.name and b.date = "&actdate"d;
>quit;
>
>
>
>Hope this is helpful.
>
>
>Mark Terjeson
>Senior Programmer Analyst
>Investment Management & Research
>Russell Investments
>253-439-2367
>
>
>Russell
>Global Leaders in Multi-Manager Investing
>
>
>
>
>
>
>
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of hd
>Sent: Thursday, September 11, 2008 9:02 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: filtering according to a date
>
>Hello all,
>
>Im quite new to SAS. I have a simple question if I want to filter a
>dataset according to the date field, but the date should be dynamic.
>
>%let actdate = 31Dec1981;
>
>proc sql;
>create table temp as
>select a.* from name a, dateofbirth b
>where a.name = b.name and b.date = "31Dec1981"d;
>
>This works, But I would like the "31Dec1981"d to be dynamic so that
>when i change the variable actdate it changes to.
>
>
>
>I am not sure how to do this
>
>Many Thanks,
>
>Heena
|