|
|
5#

楼主 |
发表于 2008-7-3 14:59:07
|
只看该作者
Re: 请问怎样用input导入txt格式的数据(急,在线等)
不会啊,我刚刚试了一下你的程序,可以运行起来啊!
data example2;
infile'd:\sas\example2.txt';
input year us canada australia japan france germany italy;
run;
proc print;
run;
NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) 9.1 (TS1M3)
Licensed to Demo SID, Site 0047162208.
NOTE: This session is executing on the XP_HOME platform.
NOTE: SAS initialization used:
real time 5.34 seconds
cpu time 1.04 seconds
1 data example2;
2 infile'd:\sas\example2.txt';
3 input year us canada australia japan france germany italy;
4 run;
NOTE: The infile 'd:\sas\example2.txt' is:
File Name=d:\sas\example2.txt,
RECFM=V,LRECL=256
NOTE: 40 records were read from the infile 'd:\sas\example2.txt'.
The minimum record length was 28.
The maximum record length was 36.
NOTE: The data set WORK.EXAMPLE2 has 40 observations and 8 variables.
NOTE: DATA statement used (Total process time):
real time 0.28 seconds
cpu time 0.03 seconds
5 proc print;
6 run;
NOTE: There were 40 observations read from the data set WORK.EXAMPLE2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.12 seconds
cpu time 0.00 seconds
Obs year us canada australia japan france germany italy
1 1959 5.5 5.6 2.1 2.3 1.6 2.0 4.8
2 1960 5.5 6.5 1.6 1.7 1.5 1.1 3.7
3 1961 6.7 6.7 3.0 1.5 1.2 0.6 3.2
4 1962 5.5 5.5 2.9 1.3 1.4 0.6 2.8
5 1963 5.7 5.2 2.3 1.3 1.6 0.5 2.4
6 1964 5.2 4.4 1.4 1.2 1.2 0.4 2.7
7 1965 4.5 3.6 1.3 1.2 1.6 0.3 3.5
8 1966 3.8 3.4 1.6 1.4 1.6 0.3 3.7
9 1967 3.8 3.8 1.9 1.3 2.1 1.3 3.4
10 1968 3.6 4.5 1.8 1.2 2.7 1.1 3.5
11 1969 3.5 4.4 1.8 1.1 2.3 0.6 3.5
。。。。。。。。。。。。。。。。。。。。。。。。。。。。 |
|