I have little to zero knowledge about PostgreSQL, so there maybe an issue around using double quotes instead of the single quotes. however, if that is the case, it boils down to delivering the right code content to 'pass-thru', for which SAS Macro is invented.
So in the case of your code as following:
AND source = ANY('{&varList.}'::varchar[])
There is another way to deliver it as wrapping everything on the right of the = sign (well, you don't have to wrap everything, this is just an example) into a compound macro variable (and you can also choose to concatenate the contents directly without making new macro variables, this is for easy reading)
/*construct your macro variable*/
%let _pre=%str(ANY%(%'{);
%let varlist=src1,src2,src3,src4;
%let _post=%str(}%'::varchar[]%)) ;
%let _out= %unquote(&_pre.&varlist.&_post);
Now your code will be like:
AND source = &_out.;
... View more