Hi, I'm trying to macro-ise the following code, I have a lot of bank name cleansing to do beyond these 2 names proc sql; create table Bank_cleansed as select *, (case when (address_name contains "Bank of FR") then "Bank of France" when (address_name contains "Bank of DM") then "Bank of Germany" else address_name end) as new_address_name from Bankfile; run; I'm not quite there with the macro: %macro addname(string,fullname) proc sql; create table Bank_cleansed as select *, (case when (address_name contains &string.) then &fullname. else address_name end) as new_address_name from Bankfile; run; %mend; %addname("Bank of FR","Bank of France"); %addname("Bank of DM","Bank of Germany"); I'm thinking the code needs to be somehow embedded in the macro? Any help would be great. Thanks! Liz
... View more