By admin | August 31, 2009

SAS Certified Base Programmer 123 Questions (13)

A raw data file is listed below:

RANCH,1250,2,1,Sheppard Avenue,"$64,000"
SPLIT,1190,1,1,Rand Street,"$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"$107,250"
RANCH,1500,3,3,Kemble Avenue,"$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"$73,650"

The following SAS program is submitted using the raw data file as input:

data work.condo_ranch;
    infile'file-specification' dsd;
    input style $ @;
    if style = 'CONDO' or style = 'RANCH' then
        input sqfeet bedrooms baths street $ price : dollar10.;
run;

How many observations does the WORK.CONDO_RANCH data set contain?

A. 0
B. 3
C. 5
D. 7

6 comments | Add One

  1. admin - 08/31/2009 at 12:53 pm

    D

  2. mini - 04/4/2011 at 9:35 am

    How the answer is D? hope it is C .could you please explain??

  3. mini - 04/4/2011 at 9:36 am

    Sorry i meant about B not C

  4. Deepak - 08/11/2011 at 9:53 am

    @Mini: IF statement is not used as subsetting IF here.. It is just helping to instruct reading for specific style otherwise put missing values.

  5. Raji - 05/21/2012 at 4:52 am

    Still cant understand the logic, pl explain.

  6. Chris - 05/20/2013 at 8:43 pm

    Style would get a value for all data lines (7 lines). The rest of the data on a line would only be read for 3 obs.

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *