Please correct me if I am wrong:
/*Scenario:
1. Create a variable, Bonus, that is 5% of Income. If the Bonus is over $7000, create the variable Total that sums Bonus and Income
2. Only output observations with Bonus greater than $7000 to the New dataset, BonusOver7K,
there should be no missing value for the Bonus variable in the data set.
3.what is the value of the variable Total for observation 114?
4. what is the grand total of the variable Total for the entire data set?*/
data work.BonusOver7K;
set Souj.input24;
Bonus=Income*0.5;
where Bonus ne .;
if Bonus>7000 then Total=sum(Bouns,Income);/* I think,#1*/
if Bonus>7000 then output BonusOver7K;/* I think, #2*/
run;
Proc print data=BonusOver7K;
sum Total; /* I think, #4 */
run;
... View more