good day,
below is my program
%macro sqlmerchant(A=,B=,C=,ab=);
PROC SQL;
CREATE TABLE &A AS
SELECT * ,"&ab" AS NAME ,"Y" as Cleaned_flag FROM Merch_clean_latest_raw_backup
WHERE Merchant_Name LIKE &b
AND "merchant_name_alias.mcc"N IN (SELECT MCC FROM Merchant_list_v2 WHERE 'Merchant Category'n in &C )
;
%MEND;
%sqlmerchant(A=MCDONALD,B="%MCDONALD%",C=("Miscellaneous Stores"),ab=Mcdonald);
%sqlmerchant(A=WATSONSWINE,B="%WATSONSWINE%",C=("Miscellaneous Stores"),ab=Watsons Wine);
%sqlmerchant(A=WATSONS,B="%WATSONS%",C=("Miscellaneous Stores"),ab=Watsons);
here is my macro code.I have to search a list of merchant in a big data base.
and the list of merchant name and merchant code are stored in two excel.
can i set up a program which can let the macro read from the excel automatically . so that i can avoid to input all my name list into macro.
thanks in advance,
Harry
Combine your Excels into one dataset, from which you can then use call execute() to call your macro.
Combine your Excels into one dataset, from which you can then use call execute() to call your macro.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.