CSULB_STAT475_handout5

CSULB_STAT475_handout5 - STAT 475 Chapters 2, 19 WORKING...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 475 Chapters 2, 19 WORKING WITH DATES AND TIMES HOW SAS STORES DATE AND TIME VALUES When SAS reads a date, it converts it into the number of days from January 1, 1960. For example, January 5, 1960 SAS stores as number 4; December 16, 1989 as 10945; January 1, 1950 as -3652. When SAS reads time, it converts it into the number of seconds since midnight. For example, 12:15am is stored as (15)(60)=900; 1am is stored as (60)(60)=3600. When SAS reads date and time, it converts it into the number of seconds from the midnight on January 1, 1960. For example, April 22, 1989, 16:10:45 is stored as 92488384; July 4, 1776, 11:30:23 is stored as -5790400177. DATE FORMATS Here are some examples of date expressions and the corresponding formats. Date Expression SAS Date Format 04/11/05 MMDDYY8. 04/11/2005 MMDDYY10. 04-11-2005 MMDDYY10. 11APR05 DATE7. 11APR2005 DATE9. 11-Apr-2005 DATE11. April 11, 2005 WORDDATE. 11 April 2005 WORKDATX. Monday, April 11, 2005 WEEKDATE. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
TIME FORMATS Here are some examples of time expressions and the corresponding formats. Time Expression SAS Time Format 17:00:01.34 TIME11. 17:00 TIME5. 2:34 TIME5. Note that the smallest admissible field width in TIME formats is 5, therefore, even though the time expression 2:34 is only 4 columns wide, the width 5 must be specified. DATE AND TIME FORMATS Here are some examples of date and time expressions and the corresponding formats. Date and Time Expression SAS Datetime Format
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

CSULB_STAT475_handout5 - STAT 475 Chapters 2, 19 WORKING...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online