sunflower123q 发表于 2015-6-4 16:06
照葫芦画瓢 在format informat input语句中,在原有变量后面加入新变量的格式要求和名字
嗯,但是有个问题,
第一条语句infile有规定读excel的几列的问题吗?
我改了语句后发现第二列数据是读不进去的。。。
我的程序改成:
Data exp;
Infile 'C:\Users\dell\Desktop\hs300zs.csv' delimiter = '09'x Missover Dsd lrecl=32767 firstobs=2 ;
Format Date YYMMDD10.;
Format open 10.3;
Informat Date YYMMDD10.; /*specify the format of the original data in txt for sas to read */
informat open 10.3;
Input
Date open;
run;
proc print data=exp;
run
结果如下:
Obs Date open
1 2015-05-29 .
2 2015-05-28 .
3 2015-05-27 .
4 2015-05-26 .
5 2015-05-25 .
6 2015-05-22 .
7 2015-05-21 .
8 2015-05-20 .
9 2015-05-19 .
10 2015-05-18 .
open全是缺失值,
应该跟第一行infile中读入excel的行数有关吧???