导入数据问题:
1.用数据流可以顺利导入
data test;
informat default=$char9. default =8. x6 9.;
input date $ x1-x6;
cards;
2010-1-4 3825.23 3831.02 3750.77 3751.77 31906.64 16077103
2010-1-5 3763.24 3797.68 3698.37 3776.71 50271.99 25252498
2010-1-6 3772.35 3801.51 3751.11 3754.04 46240.42 21974042
2010-1-7 3755.21 3772.98 3664.43 3687.37 43422.88 21170328
2010-1-8 3671.88 3694.32 3633.79 3692.89 32880 16208307
2010-1-11 3834.01 3840.65 3670.34 3689.22 57172 28771342
run;
2.用外部.dat导入出错 (其.dat内容格式与上例cards列出完全相同),请教原因:
data test;
infile 'E:\thesis data\newdata\idx\dc.dat';
informat default=$char9. default =8. x6 9.;
input date $ x1-x6;
run;
839 data test;
840 infile 'E:\thesis data\newdata\idx\dc.dat';
841 informat default=$char9. default =8. x6 9.;
842 input date $ x1-x6;
843 run;
NOTE: The infile 'E:\thesis data\newdata\idx\dc.dat' is:
File Name=E:\thesis data\newdata\idx\dc.dat,
RECFM=V,LRECL=256
NOTE: Invalid data for x1 in line 2 1-58.
NOTE: Invalid data for x2 in line 3 1-58.
NOTE: Invalid data for x3 in line 4 1-58.
NOTE: Invalid data for x4 in line 5 1-55.
NOTE: Invalid data for x5 in line 6 1-56.
NOTE: LOST CARD.
NOTE: Invalid data errors for file ''E:\thesis data\newdata\idx\dc.dat'' occurred outside the
printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
x6=. date=2010-1-4 x1=. x2=. x3=. x4=. x5=. _ERROR_=1 _N_=1
NOTE: 6 records were read from the infile 'E:\thesis data\newdata\idx\dc.dat'.
The minimum record length was 55.
The maximum record length was 58.
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.TEST has 0 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
