title: How to create a new variable in SAS by extracting part of the value of an existing numeric variable with a condition from a catagorical variable?
body: <p>I want to create a new variable called <strong>Sales_of_win7</strong> I have two variables one is  <strong>Total sale</strong> (Numeric variable)and another one is <strong>ProductGRpID</strong> which is a catagorical variable which contains(Two catagories: Win7 and Printers). So I want to create a variable <strong>Sales_of_win7</strong> by extracting value from <strong>Total Sale</strong> if it only win7 in <strong>ProductGRpID</strong>. How can I do that?. Your help is appreciated.</p>