By admin | October 9, 2009

SAS Certified Base Programmer 123 Questions (114)

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

----|----10---|----20---|----30
01012000

The following SAS program is submitted:

data test;
    infile,calendar';
    input@1 data mmddyy10.;
    if date='01012000'd then event='january 1st';
run;

Which one of the following is the value of the EVENT variable?

A. 01012000
B. January 1st
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.

10 comments | Add One

  1. admin - 10/9/2009 at 10:52 am

    D

  2. roxanne - 03/9/2010 at 8:56 pm

    Could you please explain the reason? Thank you very much.

  3. admin - 03/12/2010 at 8:02 pm

    @2. roxanne …..I confirmed that D is correct…you should install SAS and try it.

  4. roxanne - 03/27/2010 at 10:10 am

    yes,now i can understand that. thank you!

  5. sudha - 12/19/2010 at 6:14 am

    correct infile statement as infile ‘calendar’;

  6. chayan - 12/26/2011 at 7:28 am

    reason of errors :-
    1> ‘data’ instead of date….(ok..it may be a simple spelling mistake)
    2>wrong informat

  7. eno - 04/27/2012 at 5:02 pm

    I still don’t get why it is not C. For example, if I try to input a numeric variable when the raw file actually has a character, the execution will keep going and I get missing value as the value.

  8. Huazi Zeng - 10/13/2012 at 9:38 pm

    @2, ‘01012000’d is not correct date constant form, general form of date constant is ‘ddmmmyy’d or ”ddmmmyy”d.

  9. uma - 02/1/2013 at 11:48 am

    answer is d becoz for calender it should be closed with qoutes thats y it is a syntax error

  10. chentail - 02/18/2013 at 3:39 pm

    a comma at infile statement
    date variable does not exist

Leave a Comment

Leave a Reply

Your email address will not be published.