matchlessboy 发表于 2013-3-15 05:10 
想到一个笨办法,只对你这种特殊情况有用,同求其他方法.
data aaa;
infile 'c:\MyRawData\Traff ...
Another 笨办法.
data like_sas ;
length name $28 add1 add2 $8;
input dummy $ @;
if dummy='surface' then do;
add2=scan(_infile_,-1,' ');
add1=scan(_infile_,-2,' ');
name=substr(_infile_,length(dummy)+1,
length(_infile_)-length(dummy)-length(add1)-length(add2)-2);
output;
end;
keep name add:;
cards ;
freeway 408 3684 3459
surface Martin Luther King Jr. Blvd. 1590 1234
surface Broadway 1259 1290
surface Rodeo Dr. 1890 2067
freeway 608 4583 3860
freeway 808 2386 2518
surface Lake Shore Dr. 1590 1234
surface Pennsylvania Ave. 1259 1290
;
proc print;run ;