Hi all,
I have a series of date range macro variables which I define at the beginning of a program.
%let high_date = '22JUL2017'd;
data _null_;
call symput('START_DATE',put(&high_date.-1095,date8.));
call symput('END_DATE',put(&high_date.,date8.));run;
The date range macro vars have to be defined this way in order to use them when running a query on an Oracle database through the SAS environment.
Later on in the program, I have to use these macro values in a SAS date time format for queries which have lines of proc sql code which look like this...
when max(datepart(TRANSACTION_DATE)) between &START_DATE. and &END_DATE. then 1 end as Customer_Status
I recive this error when I try to run lines of proc sql code like the above.
59 ! and);
NOTE: Line generated by the macro variable "START_DATE".
59 23JUL14
_____
22
76
ERROR 22-322: Syntax error, expecting one of the following: !!, *, **, +, -, /, AND, ||.
ERROR 76-322: Syntax error, statement will be ignored.
I am having trouble figuring out how to change these date macro variables into SAS date time values so they can be used in a proc sql query.
data want;
set have;
sasdate=input(&START_DATE.,date8.) ;
run;
I have been trying variations of the code below but no luck.
Between input(&START_DATE.,date8.) and input(&END_DATE_ACT.,date8.)
Any assistance will be greatly appreciated. Thank so much!
... View more