12490 19261231 . .
12490 19260102 0.020761246 0.00543
12490 19260104 -0.011864407 0.000695
12490 19260105 -0.018867925 -0.004721
12490 19260106 -0.013986014 -0.000448
12490 19260107 0.017730497 0.005034
12490 19260108 -0.015679443 -0.003124
12490 19260109 0.015929204 0.002292
12490 19350909 0.002721089 0.001936
12490 19350910 0.001356852 0.005636
12490 19350911 0.001355014 0.004358
12490 19350912 0.00405954 -0.008301
12490 19350913 -0.001347709 0.000753
12490 19350914 -0.004723347 -0.001585
12490 19350916 0.006101695 -0.003627
然后我写了一个程序读这个文件:
DATA aaa;
infile 'C:\stock1.csv' dsd;
INPUT firm $ date yymmdd8. r rm;
format date yymmdd8.;
run;
title "list of original data";
proc print data=aaa;
run;
打印出来的结果是:
Obs firm date r rm
1 12490 25-12-31 . .
2 12490 26-01-02 . 0.020761
3 12490 26-01-04 . -0.011864
4 12490 26-01-05 . -0.018868
5 12490 26-01-06 . -0.013986
6 12490 26-01-07 . 0.017730
7 12490 26-01-08 . -0.015679
8 12490 26-01-09 . 0.015929
9 12490 35-09-09 . 0.002721
10 12490 35-09-10 . 0.001357
11 12490 35-09-11 . 0.001355
12 12490 35-09-12 . 0.004060
13 12490 35-09-13 . -0.001348
14 12490 35-09-14 . -0.004723
15 12490 35-09-16 . 0.006102
我猜是因为日期读入格式不对,导致把r 读成rm,而真正的rm却读不到。但是不知道怎么改正。请帮忙看看.谢谢.
[此贴子已经被作者于2008-2-20 1:01:14编辑过]