|
John,
Why are you using a macro variable anyway. You are doing it incorrectly.
%let date=date();
Stores the string date() in the macro variable.
Then
a=intnx('month',"&date"d,-1);
Translates to
a=intnx('month',"date()"d,-1);
Which makes no sense.
Why not just:
a=intnx('month',date(),-1);
HTH,
Dennis Diskin
ma015 b8234 <ma015b8234@BLUEYONDER.CO.UK>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
09/03/2003 03:14 PM
Please respond to ma015 b8234
To: SAS-L@LISTSERV.UGA.EDU
cc:
Subject: Macrovariable not resolving in Intnx function
Dear SAS-L Contributors:
I am trying to get the last month from today's date and export
it to Excel. But I get an error because the macro variable does not
resolve
within the intnx function.
Any suggestions for getting around this?
Thanks in advance for your help.
John
filename otherway dde
'Excel|D:\DQ\Reports\[Monthly_Report.xls]Data!R2C3:R2C3';
data _null_;
file otherway;
%let date=date();
a=intnx('month',"&date"d,-1);
put a;
run;
219 a=intnx('month',"&date"d,-1);
--------
77
ERROR: Invalid date/time/datetime constant "&date"d.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 77-185: Invalid number conversion on "&date"d.
|