Question6:ThefollowingSASprogramissubmitted:
datatest;
setsasuser.employees;
if2leyears_servicele10then
amount=1000;
elseifyears_servicegt10then
amount=2000;
else
amount=0;
amount_per_year=years_service/amount;
run;
WhichoneofthefollowingvaluesdoesthevariableAMOUNT_PER_YEARcontainifanemployeehasbeenwiththecompanyfor
oneyear?

1.0
2.1000
3.2000
4..(missingnumericvalue)
CorrectAnswer:4
Exp:TheAnswerwillbe4asamountwillbe0andtheper_yearshouldbecalculatedonlyifamountne0.Assumingthevariablenamearevalid.
Forvariablenamesonly,SASremembersthecombinationofuppercaseandlowercaselettersthatyouusewhenyoucreatethevariablename.Internally,thecaseoflettersdoesnot
matter."CAT,""cat,"and"Cat"allrepresentthesamevariable.Butforpresentationpurposes,SASrememberstheinitialcaseofeachletterandusesittorepresentthevariable
namewhenprintingit.
Thevariablelengthisnotaproblem,itcanbemorethan8chars.Variablenameisnotaproblem,
1.Sincedivisionbyzero,Mathematicaloperationscouldnotbeperformed
2.Theresultsoftheoperationshavebeensettomissingvalues