I'm confused. When I run your macro, like:
%put WHERE t1.TARIH_ID IN (&date_list) ;
I get:
WHERE t1.TARIH_ID IN ("01JAN1960:06:33:39"dt, "01JAN1960:06:33:08"dt, "01JAN1960:06:32:37"dt)
I understand that's not the value you want. But in your question, it looks like you're getting a TO_DATE, which is apparently a PROC DS2 function.
Is the TO_DATE function somewhere in your code? Or it being added by the EG filter? (I don't know how EG filters work).
If your goal is got get values like:
31AUG2024:23:59:59
31JUL2024:23:59:59
30JUN2024:23:59:59
You can get that by using the datetime() function to get the current date-time, instead of the today() function which gives you the current date. Also in the INTNX function use DTMONTH as the interval instead of MONTH. You can do it all in one statement in the macro language, like:
%put %sysfunc(intnx(dtmonth, %sysfunc(datetime()), -1, E),datetime20) ;
%put %sysfunc(intnx(dtmonth, %sysfunc(datetime()), -2, E),datetime20) ;
%put %sysfunc(intnx(dtmonth, %sysfunc(datetime()), -3, E),datetime20) ;
... View more