楼主: sunquan3075
10815 15

[问答] 如何导入excel中的时间日期变量 [推广有奖]

11
sunquan3075 发表于 2011-1-8 02:14:29
9# baoaibaobao
能不能详解一下strip()函数的用法哦?找了下没找到。。

12
baoaibaobao 发表于 2011-1-8 09:38:15

13
hhh83 发表于 2011-12-4 20:21:02
我也遇到相似的问题。后来找到了一个方法,你不妨试试看,用工具栏的图标导入,相信你这一点也试过,这里是关键在于在选择导入excel格式的时候,在下拉框中要选择excel5……7(大概是怎么个东东),不要选择excel2000……这一项。

14
idiele 发表于 2012-5-22 18:04:44
9#baoaibaobao
could you tell me what type is the variable b in the put function?
I tried with the above code, but the log reported that my variable ‘rpt_pr' had already been defined as numeric, so that it cannot been changed to char.! but isn't put function used to do such transfer?

following is my code:
"year=input(substr(strip(put(rpt_pr,$12.)),1,4),4.);"

15
潇湘夜雨spp 发表于 2014-1-8 19:21:15
proc import out=a
datafile='f:\riqi.xls'
dbms=excel2010
replace;
run;

data c;
set a(keep=ri);
format ri yymmdd10.;
informat ri yymmdd10.;
run;
貌似这样就可以导入,注意输入输出格式

16
潇湘夜雨spp 发表于 2014-1-8 19:22:20
使用的是这个文件

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 02:17