我有6年每月的数据存储在文本文件中,排列如下,每一列表示1年12个月的数据:
330.45 330.97 331.64 332.87 333.61 333.55
331.90 330.05 328.58 328.31 329.41 330.63
331.63 332.46 333.36 334.45 334.82 334.32
333.05 330.87 329.24 328.87 330.18 331.50
332.81 333.23 334.55 335.82 336.44 335.99
334.65 332.41 331.32 330.73 332.05 333.53
334.66 335.07 336.33 337.39 337.65 337.57
336.25 334.39 332.44 332.25 333.59 334.76
335.89 336.44 337.63 338.54 339.06 338.95
337.41 335.71 333.68 333.69 335.05 336.53
337.81 338.16 339.88 340.57 341.19 340.87
339.25 337.19 335.49 336.63 337.74 338.36
我该怎么样读取这些数据呢,SAS中有infile这样的语句,但是它是怎么读的呢,按行还是按列或者可以指定,我有程序如下,用print 语句打出看却没有读到数据,不知道为什么?
libname chap2'e:\work\ex2';
data chap2.ex2(label="Mauna Loa");
infile "e:\ex2.txt" firstobs=1 obs=72 ;
input co2;
time=intnx('month','01jan1975'd,_n_-1);
format time monyy.;
run;
proc print data=chap2.ex2;
run;
结果:
SAS ϵͳ 14:12 Wednesday, March 31, 2004 1
Obs co2 time
1 . JAN75
2 . FEB75
3 . MAR75
4 . APR75
5 . MAY75
6 . JUN75
7 . JUL75
8 . AUG75
9 . SEP75
10 . OCT75
11 . NOV75
12 . DEC75
请各位指教,多谢了!