%Let Alert=2017-01,2017-02,2017-03;
%Let Alert_Where=%BQuote(%Str(%')%Sysfunc(TranWrd(%BQuote(&Alert.),%Str(,),%Str(%', %')))%Str(%'));
%Put ***&Alert_Where.***;
* .. but don't do this, if it comes from a data set then use Proc SQL;
Data Dates;
D='2017-01'; Output;
D='2017-02'; Output;
D='2017-03'; Output;
Run;
Proc SQL NoPrint;
Select Catt("'",D,"'") Into :Alert_Where_SQL Separated By ',' From Dates;
Quit;
%Put ***&Alert_Where_SQL.***;
* .. else define Alert the way you need it in the first place;
%Let Alert_Comma='2017-01', '2017-02' ,'2017-03' ;
%Put ***&Alert_Comma.***;
... View more