由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 大牛们, SAS code 求助
相关主题
一个SAS 问题,紧急!how to use time format in SAS
包子请教,时间格式问题sas question
请教SAS的问题,时间变量读取,包子答谢大家练练手吧,挺有意思的一道题
请教一个SAS排序的问题【包子】date 变量 赋值问题
请教两个关于SAS的问题[合集] SAS 咋就这么难鼓捣? 大侠帮一帮!
SAS时间处理求教sas help!!
SAS 编程问题 (有包子)问个sas日期小白问题
请教SAS转换variable format informatHow to convert a SAS char variable to a date variable.
相关话题的讨论汇总
话题: sas话题: date话题: 10nov05话题: anydtdte16话题: format
进入Statistics版参与讨论
1 (共1页)
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
4
directly?
J*X
发帖数: 1001
5
我跟你讲的length不就是个function?非要纠结一个时间/日期function?
b********1
发帖数: 291
6
楼主啥背景? sas用的多么?
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
12
你试试anydtdte10.
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一下
1 (共1页)
进入Statistics版参与讨论
相关主题
How to convert a SAS char variable to a date variable.请教两个关于SAS的问题
急问SAS时间处理求教
请教SAS base的几道题SAS 编程问题 (有包子)
Import excel file to SAS请教SAS转换variable format informat
一个SAS 问题,紧急!how to use time format in SAS
包子请教,时间格式问题sas question
请教SAS的问题,时间变量读取,包子答谢大家练练手吧,挺有意思的一道题
请教一个SAS排序的问题【包子】date 变量 赋值问题
相关话题的讨论汇总
话题: sas话题: date话题: 10nov05话题: anydtdte16话题: format