I have a work table named WORK.WEEK_YEAR_FESTIVITA with two records with dates 08dec2022 and 09dec2022 in the field "HolidayDate" and I would to convert this list in a macro variable like "Elenco_Date = '08dec2022'd,'09dec2022'd" and so on for other possible dates in the table WORK.WEEK_YEAR_FESTIVITA. I tried with this proc SQL:
proc sql noprint; select distinct HolidayDate into : Elenco_Date separated by "'d," from WORK.WEEK_YEAR_FESTIVITA; quit;
%put &Elenco_Date;
but the result IS:
ELENCO_DATE = 08DEC2022'd,09DEC2022;
and not
ELENCO_DATE = '08DEC2022'd,'09DEC2022'd;
as desired
Do you have suggestions?
Thanks
Create the date literal strings in the column list part of the SELECT statement.
Or you could just store the raw number of days into the macro variable.
Since there is no difference between using
and