|
|
|
||||
|
|
|||||
data test;
infile "e:\data\attach\dd6429cm.wave1" length=len;
length junk $ 1
varname $ 8 x $ 80;
input x $varying. len @;
if substr(x,1,1) = "D" then do;
input @1 junk varname varlen varpos1 ;
varpos2 = varpos1 + varlen - 1;
output;
end;
else
do;
input ;
end;
run;
proc print data=test;
var varname varpos1 varpos2 ;
run;
data _null_;
file "d:\temp\sasprog.txt" ;
set test end=lastobs;
if _n_ = 1 then put "input " ;
put " " varname " " varpos1 "-" varpos2 ;
if lastobs then put ";" ;
run;
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services