%let output=C:\temp\result.txt; filename stud "&output"; data studd ;infile stud length=lg;input @;input @1 eachline $varying500. lg; X=substr(eachline,18,1); beginning=substr(eachline,1,10); run; data coeff; set studd; where X ="%" or eachline contains "Category Counts Cum." or eachline contains "Score Used % % " or beginning contains "Table 8." or eachline contains "Model = " ; run; proc print noobs; var eachline; run;