p***7 发帖数: 535 | 1 现在我的date数据有两种形式: 10NOV05或者 10NOV05:03:49:19, 我需要不同的处
理: if date.......then date2=datepart(date); else if date.......then date2=
date; 省略号处如何写呢?Thanks!! |
J*X 发帖数: 1001 | 2 ......这个看着很简单啊,用length做条件不行? |
p***7 发帖数: 535 | 3 A good idea, but is there a function in SAS that can differentiate the
format difference between the two? Thx. |
p***7 发帖数: 535 | |
J*X 发帖数: 1001 | 5 我跟你讲的length不就是个function?非要纠结一个时间/日期function? |
b********1 发帖数: 291 | |
J*X 发帖数: 1001 | 7 似乎是统计小硕
【在 b********1 的大作中提到】 : 楼主啥背景? sas用的多么?
|
p***7 发帖数: 535 | 8 It is funny, but thanks for the idea. It seems length doesn't work here,
since length function returns 12 for all the formats of datetime....... |
m***6 发帖数: 884 | 9 SAS indeed has a date format to read all kinds of data. Try the following:
data _null_;
format x mmddyy10. ;
x = input('10NOV05', anydtdte16.) ;
put x = ;
x = input('10NOV06:03:49:19', anydtdte16.) ;
put x = ;
Run; |
p***7 发帖数: 535 | 10 it is great!
【在 m***6 的大作中提到】 : SAS indeed has a date format to read all kinds of data. Try the following: : data _null_; : format x mmddyy10. ; : x = input('10NOV05', anydtdte16.) ; : put x = ; : x = input('10NOV06:03:49:19', anydtdte16.) ; : put x = ; : Run;
|
p***7 发帖数: 535 | 11 Don't why, The format of my date is 12/12/2011, it can't be input to
anydtdte16. it returned to missing values.??? |
m******r 发帖数: 1033 | |
p***7 发帖数: 535 | 13 it is strange but it didn't work. It seems that anydtdte causes lots
troubles |
m******r 发帖数: 1033 | 14 你好好google把, anydt 是sas造的最牛b的东西之一。 成功了别忘了上来update一下
。 |