Hi all, I've created a list &WestAfrlist in proc sql (not shown). The %put looks great and produces a list of countries in W. Africa. Now, I want to search that list for a match in the variable "country1" for each observation in my dataset. In other words, if for an observation country1=Benin, I'd like to search WestAfrlist for Benin and return a value of 1 for "region_ind". With the bad code below, region_ind doesn't initialize and ERROR: Variable REGION_IND not found. Version 9.4. %macro abc(dv); %let findabc=%index(&WestAfrlist.,dv); %if &findabc=1 %then %do; region_ind=1; %end; %mend abc; data travel2017; set travelhx; if country1='NA' then country1=""; %abc (country1); run; Any ideas on how to accomplish this? Thanks in advance.
... View more