Date: Thu, 23 Jun 2005 10:51:18 +1200
Reply-To: Bruce Wright <Bruce.Wright@IAG.CO.NZ>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Bruce Wright <Bruce.Wright@IAG.CO.NZ>
Subject: Re: date - macro variable problem
Content-Type: text/plain; charset="us-ascii"
My favourite trick is to use a data _null_ step ...
Data _Null_;
Date_to_use = intnx("month", today(), 0, "B");
call symput(Start_Date, "'"||put(Date_to_use, Date9.)||"'D";
Run;
This way you put in the quotes and D as well (if desired).
Cheers,
Bruce Wright
Senior Actuarial Analyst
Pricing & Reporting
Please consider our future and avoid printing this email where possible.
IAG New Zealand Limited
Level 15, 151 Queen Street
Private Bag 92130
Auckland, New Zealand
T +64 9 969 6121
Extn 96121
F +64 9 969 6364
E Bruce.Wright@iag.co.nz
www.iag.co.nz
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
toby dunn
Sent: Thursday, 23 June 2005 10:21
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: date - macro variable problem
David,
You have two choices either get the SAS date for 01JUN05 in the macro
var
and pass that or get it into a SAS date in the datastep:
%let date = %sysfunc(inputn('01JUN05',date9.)) ;
or
IF ((profiledt >= "&START_DT"D) AND (profiledt <= "&END_DT"D));
Toby Dunn
From: David Fickbohm <davefickbohm@YAHOO.COM>
Reply-To: David Fickbohm <davefickbohm@YAHOO.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: date - macro variable problem
Date: Wed, 22 Jun 2005 15:13:25 -0700
People,
I am trying to use macro variables instead of harding coding 15jun05'd.
I am using %let start_dt = 01JUN05;
and the code below.
DATA all_profiles_FINAL;
SET ALL_PROFILES_CLEANED;
PROFILEDT = DATEPART(PROFILE_DT);
IF ((profiledt >= "&START_DT'D") AND (profiledt <= "&END_DT'D"));
RUN;
Can someone please give me an idea where to look in a manual or a book
or
something.
Sorry
Dave
Dave Fickbohm
Use Technology to the Fullest
1250 45th st suite 200
Emeryville, CA, 94608
510 594 4151 voice
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
====================
This e-mail message has been scanned for viruses and content by IAG New
Zealand (www.iag.co.nz).
====================
"Committed to helping out in our community."
If you receive this message by mistake, please notify the sender at IAG New Zealand Limited
immediately and destroy the message. This message and any attachments may be confidential or
privileged. You may be liable if you use or retain this information without IAG NZ's permission.
Any information that does not relate to IAG NZ's official business is not given or endorsed by IAG
NZ. Thank you.