By admin | September 11, 2009

SAS Certified Base Programmer 123 Questions (39)

A raw data file is listed below:

----|----10---|----20---|----30
John McCloskey 35 71
June Rosesette 10 43
TinekeJones 9 37

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

data work.homework;
    infile 'file-specification';
    input name $ age height;
    if age LE 10;
run;

How many observations will the WORK.HOMEWORK data set contain?

A. 0
B. 2
C. 3
D. No data set is created as the program fails to execute due to errors.

9 comments | Add One

  1. admin - 09/11/2009 at 2:18 pm

    C

  2. AMJ - 03/2/2010 at 4:02 pm

    I tested this and it was wrong. It should be B

  3. admin - 03/12/2010 at 7:56 pm

    @2. AMJ….I have checked it..the answer is C….

  4. Nethe - 10/16/2010 at 4:50 pm

    Por favor revisar a respuesta es B cuando se toma la información desde un Raw data file se tiene 2 observaciones. por favor puede revisar el sigueinte código
    LIBNAME sas1 ‘C:\estudio sas\s1.txt’;
    DATA Y;
    INFILE sas1;
    INPUT NAME $ AGE HEIGHT;
    IF AGE LE 10;

    ;
    RUN;

    PROC PRINT DATA= Y; RUN;

  5. admin - 10/18/2010 at 9:18 pm

    @Nethe Please write your comment in ENGLISH!

  6. sudha - 12/7/2010 at 12:19 pm

    C is the correct answer. age is taken as missing value……..so less 9 for sure….try it with same data….

  7. sowmya - 12/22/2010 at 4:44 am

    C is the right answer. since there are two words in the name, age is considered as missing in the first two observations.In the third observation name has a single word and the age is 9. that is the reason all the observations are printed.

  8. Crystal - 07/30/2012 at 3:28 pm

    B is right one since the third observation should be . 43 . and

    43>9

    it use ” ” as the delimiter.

  9. Crystal - 07/30/2012 at 3:29 pm

    I means it uses a space as the delimiter.

Leave a Comment

Leave a Reply

Your email address will not be published.