By admin | September 17, 2009

SAS Certified Base Programmer 123 Questions (57)

The SAS data set named WORK.TEST is listed below:

capacity airplanetype staff
150      Large        10

Which one of the following SAS programs created this data set?

A.

data work.test;
    capacity = 150;
    if 100 le capacity le 200 then
        airplanetype = 'Large' and staff = 10;
    else airplanetype = 'Small' and staff = 5;
run;

B.

data work.test;
    capacity = 150;
    if 100 le capacity le 200 then
        do;
            airplanetype = 'Large';
            staff = 10;
        end;
    else
        do;
            airplanetype = 'Small';
            staff = 5;
        end;
run;

C.

data work.test;
    capacity = 150;
    if 100 le capacity le 200 then
        do;
            airplanetype = 'Large';
            staff = 10;
    else
        do;
            airplanetype = 'Small';
            staff = 5;
    end;
run;

D.

data work.test;
    capacity = 150;
    if 100 le capacity le 200 then;
        airplanetype = 'Small';
        staff = 5;
    else;
        airplanetype = 'Large';
        staff = 10;
run;

3 comments | Add One

  1. admin - 09/17/2009 at 9:53 am

    B

  2. rob roy - 09/3/2012 at 4:21 am

    options b and c are the same?

  3. Fleevi - 07/9/2014 at 3:43 pm

    for C, the first do clause wasn’t properly closed with end; statement, which will result in error (tested with SAS studio)

Leave a Comment

Leave a Reply

Your email address will not be published.