The following SAS program is submitted:
data test;
set sasuser.employees;
if 2 le years_service le 10 then amount = 1000;
else if years_service gt 10 then amount = 2000;
else amount = 0;
amount_per_year = years_service / amount;
run;
set sasuser.employees;
if 2 le years_service le 10 then amount = 1000;
else if years_service gt 10 then amount = 2000;
else amount = 0;
amount_per_year = years_service / amount;
run;
Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for one year?
A. 0
B. 1000
C. 2000
D. . (missing numeric value)
4 comments:
Answer: D
Amount is set to 0 and therefore amount_per_year is set to missing..
Try this…
data test;
years_service=1;
if 2 le years_service le 10 then amount = 1000;
else if years_service gt 10 then amount = 2000;
else amount = 0;
amount_per_year = years_service / amount;
run;
So amount_per_year = .
hi sir
d
Denominator is 0 hence missing vale
Post a Comment