By admin | August 5, 2009

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)

4 comments | Add One

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

    A

  2. nil - 02/2/2011 at 7:12 am

    plz explain why

  3. ygg - 03/17/2011 at 12:57 am

    over 60 has 7 character.
    and always first assignment statement set the length

  4. R - 04/5/2011 at 10:24 pm

    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

Leave a Comment

Leave a Reply

Your email address will not be published.