Reputation: 13
I want to create a new variable called Sales_of_win7 I have two variables one is Total sale (Numeric variable)and another one is ProductGRpID which is a catagorical variable which contains(Two catagories: Win7 and Printers). So I want to create a variable Sales_of_win7 by extracting value from Total Sale if it only win7 in ProductGRpID. How can I do that?. Your help is appreciated.
Upvotes: 0
Views: 107
Reputation: 2388
data new;
set old;
if ProductGRpID = "Win7" then sales_of_win7 = total_sale;
run;
You could add an "else" statement if you want something specific to happen in other cases
Upvotes: 0