By admin | August 5, 2009

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

7 comments | Add One

  1. SAS Tutor - 08/5/2009 at 3:14 pm

    B

  2. guest - 11/24/2010 at 5:59 am

    Why not a?

  3. song - 02/7/2011 at 2:06 am

    The length of the variable Division is set to 9 when the DATA step compiles

  4. Deepak - 07/25/2011 at 7:04 am

    Answer will be ‘A’

    because if length is not defined, SAS automatically defines based on the length of first value.

  5. chayan - 12/27/2011 at 5:23 am

    @deepak ?
    why a ? the first value is “Education “..so b

  6. xyz - 04/25/2012 at 1:20 am

    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

  7. sachin - 07/21/2012 at 10:13 pm

    Answer is A. Deepak explanation is correct.

Leave a Comment

Leave a Reply

Your email address will not be published.