数学之路-sas备忘(15)
来源:互联网 发布:淘宝超级会员是几个钻 编辑:程序博客网 时间:2024/05/27 19:25
sas日期格式
DATETIMEw. Informat
Reads datetime values in the form ddmmmyy hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss.
Syntax
DATETIMEw.
Syntax Description
w
specifies the width of the input field.
Default18
Range13–40
Details
The datetime values must be in the following form: ddmmmyy or ddmmmyyyy, followed by a blank or special character, followed by hh:mm:ss.ss (the time):
dd
is an integer between 01 and 31 that represents the day of the month.
mmm
is the first three letters of the month name.
yy or yyyy
is a two-digit or four-digit integer that represents the year.
hh
is an integer between 00 and 23 that represents hours.
mm
is an integer between 00 and 59 that represents minutes.
ss.ss
is the number of seconds ranging from 00–59 with the fraction of a second following the decimal point.
DATETIMEw. requires values for both the date and the time. However, the ss.ss portion is optional.
Note: SAS interprets a two-digit year as belonging to the 100-year span that is defined by the YEARCUTOFF= system option.
Note: SAS can read time values with AM and PM in them.
Comparisons
The DATETIMEw.d informat reads datetime values with optional separators in the form dd-mmm-yy<yy> hh:mm:ss.ss AM|PM, and the date and time can be separated by a special character.
The MDYAMPMw.d in format reads datetime values with optional separators in the form mm-dd-yy<yy> hh:mm:ss.ss AM | PM, and requires a space between the date and the time.
The YMDDTTMw.d informat reads datetime values with required separators in the form <yy>yy-mm-dd/hh:mm:ss.ss.
Example
input date_and_time datetime20.;
Data Line
Result
----+----1----+----2
16mar12:11:23:07.4
1647516187.4
16mar2012/11:23:07.4
1647516187.4
16mar2012/11:23 PM
1647559380.0
DATETIMEw. Informat
Reads datetime values in the form ddmmmyy hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss.
Syntax
DATETIMEw.
Syntax Description
w
specifies the width of the input field.
Default18
Range13–40
Details
The datetime values must be in the following form: ddmmmyy or ddmmmyyyy, followed by a blank or special character, followed by hh:mm:ss.ss (the time):
dd
is an integer between 01 and 31 that represents the day of the month.
mmm
is the first three letters of the month name.
yy or yyyy
is a two-digit or four-digit integer that represents the year.
hh
is an integer between 00 and 23 that represents hours.
mm
is an integer between 00 and 59 that represents minutes.
ss.ss
is the number of seconds ranging from 00–59 with the fraction of a second following the decimal point.
DATETIMEw. requires values for both the date and the time. However, the ss.ss portion is optional.
Note: SAS interprets a two-digit year as belonging to the 100-year span that is defined by the YEARCUTOFF= system option.
Note: SAS can read time values with AM and PM in them.
Comparisons
The DATETIMEw.d informat reads datetime values with optional separators in the form dd-mmm-yy<yy> hh:mm:ss.ss AM|PM, and the date and time can be separated by a special character.
The MDYAMPMw.d in format reads datetime values with optional separators in the form mm-dd-yy<yy> hh:mm:ss.ss AM | PM, and requires a space between the date and the time.
The YMDDTTMw.d informat reads datetime values with required separators in the form <yy>yy-mm-dd/hh:mm:ss.ss.
Example
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
input date_and_time datetime20.;
Data Line
Result
----+----1----+----2
16mar12:11:23:07.4
1647516187.4
16mar2012/11:23:07.4
1647516187.4
16mar2012/11:23 PM
1647559380.0
DATETIMEw. Informat
Reads datetime values in the form ddmmmyy hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss.
Syntax
DATETIMEw.
Syntax Description
w
specifies the width of the input field.
Default18
Range13–40
Details
The datetime values must be in the following form: ddmmmyy or ddmmmyyyy, followed by a blank or special character, followed by hh:mm:ss.ss (the time):
dd
is an integer between 01 and 31 that represents the day of the month.
mmm
is the first three letters of the month name.
yy or yyyy
is a two-digit or four-digit integer that represents the year.
hh
is an integer between 00 and 23 that represents hours.
mm
is an integer between 00 and 59 that represents minutes.
ss.ss
is the number of seconds ranging from 00–59 with the fraction of a second following the decimal point.
DATETIMEw. requires values for both the date and the time. However, the ss.ss portion is optional.
Note: SAS interprets a two-digit year as belonging to the 100-year span that is defined by the YEARCUTOFF= system option.
Note: SAS can read time values with AM and PM in them.
Comparisons
The DATETIMEw.d informat reads datetime values with optional separators in the form dd-mmm-yy<yy> hh:mm:ss.ss AM|PM, and the date and time can be separated by a special character.
The MDYAMPMw.d in format reads datetime values with optional separators in the form mm-dd-yy<yy> hh:mm:ss.ss AM | PM, and requires a space between the date and the time.
The YMDDTTMw.d informat reads datetime values with required separators in the form <yy>yy-mm-dd/hh:mm:ss.ss.
Example
input date_and_time datetime20.;
Data Line
Result
----+----1----+----2
16mar12:11:23:07.4
1647516187.4
16mar2012/11:23:07.4
1647516187.4
16mar2012/11:23 PM
1647559380.0
DATEw. Format
Writes date values in the form ddmmmyy, ddmmmyyyy, or dd-mmm-yyyy.
Category:
Date and Time
Alignment:
Right
Syntax
Syntax Description
Details
Example
See Also
Syntax
DATEw.
Syntax Description
w
specifies the width of the output field.
Default
7
Range
5–11
Tip
Use a width of 9 to print a four-digit year without a separator between the day, month, and year. Use a width of 11 to print a four-digit year using a hyphen as a separator between the day, month, and year
Details
The DATEw. format writes SAS date values in the form ddmmmyy, ddmmmyyyy, or dd-mmm-yyyy, where
dd
is an integer that represents the day of the month.
mmm
is the first three letters of the month name.
yy or yyyy
is a two-digit or four-digit integer that represents the year.
Example
The example table uses the input value of 19068, which is the SAS date value that corresponds to March 16, 2012.
SAS Statement
Result
----+----1----+
put day date5.;
16MAR
put day date6.;
16MAR
put day date7.;
16MAR12
put day date8.;
16MAR12
put day date9.;
16MAR2012
put day date11.;
16-MAR-2012
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
- 数学之路-sas备忘(15)
- 数学之路-sas备忘(1)
- 数学之路-sas备忘(2)
- 数学之路-sas备忘(3)
- 数学之路-sas备忘(4)
- 数学之路-sas备忘(5)
- 数学之路-sas备忘(6)
- 数学之路-sas备忘(7)
- 数学之路-sas备忘(8)
- 数学之路-sas备忘(9)
- 数学之路-sas备忘(10)
- 数学之路-sas备忘(11)
- 数学之路-sas备忘(12)
- 数学之路-sas备忘(13)
- 数学之路-sas备忘(14)
- 数学之路-sas备忘(16)
- 数学之路-sas备忘(17)
- 数学之路-sas备忘(18)
- Android 深入分析动态管理Fragment
- C++中的引用
- 学习Hadoop 使用虚拟机安装CentOS6.5 专治NetworkManager 找不到eth0
- HDOJ 题目4648 Magic Pen 6(水题)
- Qt学习笔记--编程技巧总结
- 数学之路-sas备忘(15)
- HTTP Keep-Alive模式
- iOS开发之多线程编程 (1)
- opencv 3.0 LUT GPU加速
- MapReduce实现倒排索引
- MIDI文件研究
- An Easy Task HDU1076
- 编程调试bat脚本常用命令
- C++十进制到各种进制转换的实现