My original code:
%let customer = ('ABC','CDE');
data cust;
set cust;
if customer in &customer then discount = discount*0.1;
run;
Question:
I have put the customer info in dataset to avoid input manually into the program
dataset (dataset name: CUST)
customer
ABC
CDE
May i know how to read the customer name from the dataset? and work get the similar result as my original code.
Anyone can help? Please advise. Thanks.
Assuming you put your list of special customers in dataset specialCust, you can adjust their discount in dataset CUST with:
proc sql;
update cust
set discount = discount*0.1
where customer in (select customer from specialCust);
quit;
(untested)
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.