SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Quiz: Reading Date and Time Values

Select the best answer for each question and click Score My Quiz.

  1. SAS date values are the number of days since which date?

     a.   January 1, 1900
     b.   January 1, 1950
     c.   January 1, 1960
     d.   January 1, 1970

  2. A great advantage of storing dates and times as SAS numeric date and time values is that . . .

     a.   they can easily be edited.
     b.   they can easily be read and understood.
     c.   they can be used in text strings like other character values.
     d.   they can be used in calculations like other numeric values.

  3. SAS software does not automatically account for daylight savings time, but it does make adjustments for:

     a.   leap seconds
     b.   leap years
     c.   Julian dates
     d.   time zones

  4. An input data file has date expressions in the form 10222001. Which SAS informat should you use to read these dates?

     a.   DATE6.
     b.   DATE8.
     c.   MMDDYY6.
     d.   MMDDYY8.

  5. The minimum width of the TIMEw. informat is:

     a.   4
     b.   5
     c.   6
     d.   7

  6. Shown below are date and time expressions and corresponding SAS datetime informats. Which date and time expresssion cannot be read by the informat shown beside it?

     a.   30May2000:10:03:17.2   DATETIME20.
     b.   30May00 10:03:17.2   DATETIME18.
     c.   30May2000/10:03   DATETIME15.
     d.   30May2000/1003   DATETIME14.

  7. What is the default value of the YEARCUTOFF= system option?

     a.   1900
     b.   1910
     c.   1920
     d.   1930

  8. Suppose your input data file contains the date expression 13APR2009. The YEARCUTOFF= system option is set to 1910. Because of the last two digits in the variable's year value, SAS software will read the date as:

     a.   13APR1909
     b.   13APR1920
     c.   13APR2009
     d.   13APR2020

  9. Suppose the YEARCUTOFF= system option is set to 1920. An input file contains the date expression 12/08/1925, which is being read with the MMDDYY8. informat. Which date will appear in your data?

     a.   08DEC1920
     b.   08DEC1925
     c.   08DEC2019
     d.   08DEC2025

  10. Suppose your program creates two variables from an input file. Both variables are stored as SAS date values: FirstDay records the start of a billing cycle and LastDay records the end of that cycle. The code to calculate the total number of days in the cycle would be:

     a.   TotDays=lastday-firstday;
     b.   TotDays=lastday-firstday+1;
     c.   TotDays=lastday/firstday;
     d.   You cannot use date values in calculations.



back||next

Terms of Use & Legal Information | Privacy Statement