SAS Certified Base Programmer 50 Questions (13)
The following SAS program is submitted:
data names; title='EDU'; if title='EDU' then Division='Education'; else if title='HR' then Division='Human Resources'; else Division='Unknown'; run;
Which one of the following represents the value of the variable Division in the output data set?
a. Educatio
b. Education
c. Human Re
d. Human Resources
Topics:
SAS Base Questions |
7 Comments »
B
Why not a?
The length of the variable Division is set to 9 when the DATA step compiles
Answer will be ‘A’
because if length is not defined, SAS automatically defines based on the length of first value.
@deepak ?
why a ? the first value is “Education “..so b
Answer will be B : education that is because the length of the division is not defined so it will take the length of the first value of division
Answer is A. Deepak explanation is correct.