SAS Certified Base Programmer 50 Questions (17)
The following SAS program is submitted:
data fltaten; input jobcode $ salary name $; cards; FLAT1 70000 Bob FLAT2 60000 Joe FLAT3 30000 Ann ; run; data desc; set fltaten; if salary>60000 then description='Over 60'; else description='Under 60'; run;
What is value of the variable named description when the value for salary is 30000?
a. Under 6
b. Under 60
c. Over 60
d. ” (missing character value)
Topics:
SAS Base Questions |
4 Comments »
A
plz explain why
over 60 has 7 character.
and always first assignment statement set the length
since we didnt set the length of the variable description, at the first pass, salary if 70k and the condition satisfies so description is set to length “over 60” which is 7 chars.. so next time it has to write “under 60” SAS trims it to 7 chars and writes only under 6 of 7 chats