I've a macro variable and it resolves to date value as follows.
SYMBOLGEN: Macro variable FIRSTDAYOFREPORTINGMONTH resolves to 01SEP2018
24 %put FirstDayofReportingMonth = &FirstDayofReportingMonth;
FirstDayofReportingMonth = 01SEP2018
25 %put LastDayofReportingMonth = &LastDayofReportingMonth;
SYMBOLGEN: Macro variable LASTDAYOFREPORTINGMONTH resolves to 30SEP2018
LastDayofReportingMonth = 30SEP2018
Now I need to extract the data based on date value and I should not hard code the date value. Therefore I tried to to filter the data with the use of macros, but I'm getting the error as mentioned below. Appreciate if someone of you tell me to know to extract the data with the help of date macro.
/*ERROR-1*/
68 /* where KNDTOP between '01sep2018'd and '30sep2018'd*/
69 where KNDTOP between &FirstDayofReportingMonth. and &LastDayofReportingMonth.
SYMBOLGEN: Macro variable FIRSTDAYOFREPORTINGMONTH resolves to 01SEP2018
SYMBOLGEN: Macro variable LASTDAYOFREPORTINGMONTH resolves to 30SEP2018
NOTE 138-205: Line generated by the macro variable "FIRSTDAYOFREPORTINGMONTH".
69 01SEP2018
_______
22
ERROR 22-322: Syntax error, expecting one of the following: !!, *, **, +, -, /, AND, ||.
/*ERROR-2*/
68 /* where KNDTOP between '01sep2018'd and '30sep2018'd*/
69 where KNDTOP between '&FirstDayofReportingMonth.'d and '&LastDayofReportingMonth.'d
ERROR: Invalid date/time/datetime constant '&FirstDayofReportingMonth.'d.
ERROR: Invalid date/time/datetime constant '&LastDayofReportingMonth.'d.
... View more