ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 95

The following SAS DATA step executes on Monday, April 25, 2000:
data newstaff;
set staff;
start_date = today();
run;
Which one of the following is the value of the variable START_DATE in the output data set?
A. a character string with the value '04/25/2000'
B. a character string with the value 'Monday, April 25, 2000'
C. the numeric value 14725, representing the SAS date for April 25, 2000
D. the numeric value 04252000, representing the SAS date for April 25, 2000
Click Comment link to get answer

18 comments:

  1. Replies
    1. hello could u please explain me how the answer is C i thought it should be D

      Delete
    2. Anonymous11:02 AM

      The easiest way to think about it is the # of days to Jan 1, 1960. If you even think about it roughly, 40 years * 365 days = 14,600 days, which is much closer to the value of C than D.

      Delete
    3. Anonymous1:58 PM

      the function today() returns the sas date constant which is an integer value.

      Delete
    4. Anonymous2:00 PM

      & D is not an valid integer. Its a date if you look at it closely. so the correct answer is C

      Delete
    5. please why do you, take the reference with Jan 1, 1960

      Delete
  2. Anonymous7:36 AM

    Today's date is given in the SAS date form

    The Ans is:

    C. the numeric value 14725

    ReplyDelete
  3. Can anyone explain with little info, please? i am stuck in this topic. :(

    ReplyDelete
    Replies
    1. Anonymous10:57 AM

      the start_date is a numeric value. Since the SAS sets the 1/1/1960 as 0, so this date is 14725.

      Delete
    2. Could u please explain it to me properly I didn't get it and stuck in it thanks

      Delete
  4. Anonymous7:11 PM

    in SAS date is stored as numeric with '01JAN1960'd or 0 as base date. Year difference between 2000 and 1960 is 41 years. 41*365 days won't be 04252000 (huge number). Therefore, answer is C.

    Other way to is to run the code. But in exam you won't get chance to run the code. One need to answer based on simple calculation (approximate value).

    ReplyDelete
    Replies
    1. "04252000 (huge number)" this is not a no. actually. If you observes, it's 04 25 2000, the actual date 25th april 2000

      Delete
    2. we used today function over here when we use function it converts date into sas date such as numbers while when we use formats we directly coverts it into various date formats as you mentioned above

      Delete