By admin | October 7, 2009

SAS Certified Base Programmer 123 Questions (112)

The contents of the raw data file SIZE are listed below:

----|----10---|----20---|----30
72 95

The following SAS program is submitted:

data test;
    infile 'size';
    input@ 1 height 2. @ 4 weight 2;
run;

Which one of the following is the value of the variable WEIGHT in the output data set?

A. 2
B. 72
C. 95
D. . (missing numeric value)

10 comments | Add One

  1. admin - 10/7/2009 at 3:29 pm

    A

  2. Chris - 08/13/2010 at 1:29 am

    Can you give some explanation?

  3. James - 09/1/2010 at 4:39 pm

    Weight is assigned value of 2, instead of using a 2. informat. try it.

  4. sachin - 01/20/2012 at 2:41 am

    above explaination is worng…its is not assigning value 2…but it is selecting column 2 value from raw file which is 2…try with the different numbers….

  5. akived - 02/25/2012 at 1:02 am

    james is correct

  6. Huazi Zeng - 10/13/2012 at 9:18 pm

    @3, I think your explanation is wrong, weight 2 means column input, so input value of 2, you can try weight 1, then you will find the value of weight is 7.

  7. Renu - 10/23/2012 at 1:38 pm

    D is the correct answer try it

  8. sdelli - 01/6/2013 at 12:53 pm

    wrong explanation James, the 2 is read from the second column of the raw data file. Please check.

  9. himanshu - 02/28/2013 at 3:01 pm

    data testwe;
    input@ 1 height 2. @ 4 weight 2;
    cards;
    72 95
    ;
    run;

    i tried this program but it is giving me value for both height and weight as a missing…could you please explain why the answer is 2 for the weight?

  10. seizetheday - 12/3/2013 at 9:32 pm

    1 is “7”2 95 =7
    2 is 7″2″ 95 =2
    3 is 72″ “95 =.
    4 is 72 “9”5 =9
    5 is 72 9″5″ =5

    am i clear? haha.

Leave a Comment

Leave a Reply

Your email address will not be published.