/*Picking specific tables from Winsteps output files*/ /*the name of Winstep output file*/ %let output= C:\Temp\output.txt; /*the name you give to a file produced*/ %let result= C:\Temp\Table3.txt; /*what table you want to pick*/ %let pick=TABLE 3; /*or you can be more specific like this %let pick=TABLE 3.1; */ filename stud "&output"; data studd ;infile stud length=lg;input @;input @1 eachline $varying700. lg; run; /*manipulating STUDD*/ data STUDD2; set STUDD; header=substr(eachline,2,6); if header ne "TABLE" then header=""; if header="TABLE" then head=substr(eachline,2,10); header2=substr(eachline,1,5); if header2="TABLE" then do; head=substr(eachline,1,10); end; if head ="TABLE OF P" then head=""; drop header header2; run; data STUDD3(keep=head eachline); set STUDD2; if head ne ' ' then temp=head; retain temp; if head=' ' then head=temp; else temp=head; run; data _null_;set STUDD3; where head contains "&pick"; file "&result"; put ( eachline)(110.0); run;