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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.