You need MINOPERATOR in order use IN with the macro language. Otherwise, the macro processor does not know what to do with it.
And in this case, you are calling a macro %ctrylist right after storing the macro %ctrylist2, so that will lead to an error:
%macro ctrylist2(ctry2);
%let list2='AT','AU','CA','CH';
%if &ctry2 in (&list2) %then %do;
&ctry2;
%end;
%else %do;
%put ERROR: &ctry2 is an invalid country code.
%put ERROR: Valid country codes include &list2.
%end;
%mend ctrylist2;
%ctrylist(AU);
%ctrylist(zz);
Read more about MINOPERATOR here:
https://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003092012.htm
... View more