Date: Thu, 22 Mar 2012 18:23:32 +0000
Reply-To: "High, Robin R" <rhigh@UNMC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "High, Robin R" <rhigh@UNMC.EDU>
Subject: Re: Urgently Need Macro Help
In-Reply-To: <1332440160.10776.YahooMailNeo@web130201.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
John,
Try putting your macro variables within double quotes:
%macro rn;
proc print data=sashelp.stocks;
where "&dtb"d le date le "&dte"d;
run;
%mend rn;
%let dtb=01Aug89;
%let dte=01Aug90;
%rn
Robin High
UNMC
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of John RR
Sent: Thursday, March 22, 2012 1:16 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Urgently Need Macro Help
Hi All,
In the following program I want to read the first day of the current month and the last day of the current month
dynamically. So, that every month I don't have to change the dates. I don't like the idea of hard coding the begin and end date every month.
%let begin='01mar12'd; /*** first day of the month ***/
%let end ='31mar12'd; /*** last day of the month ***/
data daily.Daily_del_&sysdate;
set daily.comprehensive_&sysdate;
where del_date ge &begin and del_date le &end;
run;
%mend;
Thank you for your help.
JRR
|