x cd /mscdc/data/stf903x/Tools; %let pgm=txcnvt; %put &pgm; filename pgm "&pgm..sas"; *--this "conversion" run accesses a set of 4 sas data sets created at ciesin using the stf3dbf macro against stf3 .dbf files obtained from lbl over internet. We eliminate the dup. summaries (for all levels except tract, bg and mcd) and add some indices and views--; libname tx186 xport '/unitree/mscdc/data/stf903x/txix186.xpt'; libname tx187 xport '/unitree/mscdc/data/stf903x/txix187.xpt'; libname tx188 xport '/unitree/mscdc/data/stf903x/txix188.xpt'; libname tx189 xport '/unitree/mscdc/data/stf903x/txix189.xpt'; libname sasout '/unitree/mscdc/data/stf903x'; data txi;**view=txi; *<--the permanent version is sorted by slvl, geocode; set tx186.txix tx187.txix(in=in2 where=(slvl in ('060','140','150'))) tx188.txix(in=in3 where=(slvl in ('060','140','150'))) tx189.txix(in=in4 where=(slvl in ('060','140','150'))); *<--the 186-189 come from lbl cd slot #s-; by slvl; *--this is an "interleave"; *--the where filters on all but the 1st set eliminates the redundant summaries for highter level geography, repeated on each cd-rom-; if first.slvl then do; n=1; checkpop=totpop; end; else do; n+1; drop n; checkpop+totpop; drop checkpop; end; if last.slvl then do; file print; title2 'Counts by SLVL Showing Values for Last in Group'; put slvl= n= _n_= +1 areaname county= $fipcnty. geocode=; put 'Check total of pop figures for this level:' checkpop comma12.; end; run; *--now invoke the view and "pipe" results into the sort to create the "real" sas data set---; proc sort data=txi out=sasout.txi(label='Texas Inventory Extract' index=(slvl) ); by slvl geocode; run; proc contents short data=sasout.txi; run; data some/view=some; set sasout.txi; by slvl; if first.slvl then n=1; else n+1; drop n; if n le 5; *--keep up to 5 obs for each slvl--; run; proc print data=some(keep=_char_ totpop xcentrm ycentrm); by slvl; title2 'Listing of 5 obs per slvl'; run;