|
9#

楼主 |
发表于 2011-9-17 23:23:15
|
只看该作者
Re: 请教这种问题该如何解决呢??
我的办法有点取巧。
一般不好读取都会做一些变通,比如先把整行读取 再根据规律拆分。
[code:3p1jxxwn]data _a;
infile "d:\my.txt" dsd missover;
format id $8. tel $11.;
input @3 mk $2. @;
if mk="id" then input @1 idlst : $200.;
input tellst : $200.;
cnt=count(idlst,"id");
do i=1 to cnt;
id=compress(scan(idlst,2*i-1,"|"),"id: ");
tel=compress(scan(tellst,2*i,"|")," ");output;
end;
keep id tel;
run;
[/code:3p1jxxwn] |
|