数学之路-sas备忘(14)
来源:互联网 发布:淘宝联盟买家已收货 编辑:程序博客网 时间:2024/05/19 16:05
sas日期格式
data _null_;
x='7jan2012'd;put x yymm7.;
put x yymmc7.;
put x yymmd7.;
put x yymmn6.;
put x yymmp7.;
put x yymms7.;
put x yymon7.;
put x mmddyy10.;
put x yymmdd10.;
run;
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
2012:01
2012-01
201201
2012.01
2012/01
2012JAN
01/07/2012
2012-01-07
比如:
date SAS value
1959-1-1 -365
1960-1-1 0
1961-1-1 365
2008-1-1 17532
input date1:yymmdd10. date2:yymmdd10.;
format date1:yymmdd10. date2:yymmdd10.;
days1=datdif(date1,date2,'act/act');/*按实际*/
days2=datdif(date1,date2,'30/60');/*每个月30天*/
datalines;
2015-01-01 2015-02-14
2014-05-25 2014-06-21
;
proc print ;
run;
input date1:anydtdte. date2:anydtdte.;
format date1:yymmdd10. date2:yymmdd10.;
days1=datdif(date1,date2,'act/act');/*按实际*/
days2=datdif(date1,date2,'30/60');/*每个月30天*/
datalines;
2015-01-01 2015-02-14
2014-05-25 2014-06-21
;
proc print ;
title "anydtdte";
run;
input date1:anydtdte. date2:anydtdte.;
format date1:yymmdd10. date2:yymmdd10.;
days1=yrdif(date1,date2,'act/act');/*按实际*/
days2=yrdif(date1,date2,'30/60');/*每个月30天*/
datalines;
2013-01-01 2015-02-14
2014-05-25 2015-03-21
;
proc print ;
title "year";
run;
input date DATETIME20. ;
put "----不同日期时间格式----";
put date DATETIME18. ;
put date DATETIME20. ;
put date DATETIME15. ;
put date DATETIME12. ;
datalines;
13SEP2008:02:35:43
;
run;
Labels and Formats Window
Use the Labels and Formats window to specify labels, widths, and formats for displaying variables in the application. The window contains the following items:
Variablelists the variables for which you can customize labels and formats. This includes analysis and drill variables. You can add or delete variables by going to the corresponding variable selection windows.
Typelists the data type for the corresponding variable, as specified in the data set.
Nstands for numeric.
Cstands for character.
Defaulttype any character other than blank into the field. That value is converted to X. When the Default flag is set, values for labels and formats are read from the repository at run time. If the flag is not set, values specified here are used.
Labelenter a label up to 30 characters long for each variable. Default labels are taken from the repository.
If the Default flag is set, the labels are taken directly from the repository at run time.
Formatenter a format for displaying the variable's values in the report. The format type must match the variable type as shown in the Variable column. The field is initialized with the format from the repository.
You can enter a question mark (?) as the first character in the field to display a list of valid formats.
If the Default flag is set, the formats are taken directly from the repository at run time.
Widthspecifies a column width for displaying values of the corresponding variable in the report.
The default width is determined by analyzing the current format. If that is not possible (for example, for user-written character formats), the length of the variable is used. Field width must not be smaller than the width of the formatted values, but it can be larger, for example, to create room for long labels.
Resetreturns all values to the default values specified in the repository.
- 数学之路-sas备忘(14)
- 数学之路-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备忘(15)
- 数学之路-sas备忘(16)
- 数学之路-sas备忘(17)
- 数学之路-sas备忘(18)
- Linux C编程一站式学习第九章
- viewDidApper,viewDidLoad
- 百度2012研发工程师笔试
- iOS开发工具——统计Crash的工具Crashlytics
- Python编程基础之十六多线程编程
- 数学之路-sas备忘(14)
- java 冒泡排序
- 单链表的基本操作(初始化,增加,删除)
- maven 目录结构解析
- Android启动过程
- mutt+esmtp发送的配置(linux环境,使用Gmail)
- 解决在局域网内XP不能访问win8共享的打印机问题
- debug : 如果结构中有非内建类型数据,不能用ZeroMemory来清零结构体内存
- Android4.4 CTS测试Fail项修改总结(三)