SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Date and Time Values
Reading Dates and Times Using Informats


TIMEw. Informat

The TIMEw. informat reads values in the form hh:mm:ss.ss.


General form, values read with TIMEw. informat:
hh:mm:ss.ss

where

  • hh is an integer from 00 to 23, representing the hour
  • mm is an integer from 00 to 59, representing the minute
  • ss.ss is an optional field representing seconds and hundredths of seconds.


If you do not enter a value for ss.ss, a value of zero is assumed. Here are some examples of time expressions that you can read using the TIMEw. informat:


Time Expression SAS Time Informat
17:00:01.34 TIME11.
17:00 TIME5.
2:34 TIME5.


Caution: Notice the last example. The field is only 4 columns wide, but a w value of 5 is specified. Five is the minimum acceptable field width for the TIMEw. informat. If you specify a w value less than 5, you'll receive the following error message in the SAS log:


SAS Log
ERROR 29 - 85: Width specified for format
               TIME is invalid.



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement