x cd /pub/data/stf902/Tools; %let pgm=cnvt902a; filename pgm "&pgm..sas"; *---Setup to convert the raw input data files for a state (stf902A files), creating a pair of output SAS data sets containing the A and B tables for a state. Using stf902c macro copied in sasmacro lib. Has not been used in (literally) decades before today. 11-4-14. jgb. Modified 12-24-14 to also work with stf2b or stf2c as well. -----*; %let abc=B; *--also works for A and C --; %let abclow=%lowcase(&abc); %let stab=ct; %let ustab=%upcase(&stab); %let path=%str(/pub/data/stf902/rawdata); *---There are 48 files being concatenated on input here. They came inside a .ZIP file. We may keep the .ZIP file but we will delete the 47 Fxx files once we know this convert was good. ---; filename in "&path/STF2&abc.X&ustab..F*"; libname stf902 '/pub/data/stf902'; options compress=binary; %stf902c(setouta=stf902.&stab.Atabs_file&abclow.,subfile=&abc, setoutb=stf902.&stab.Btabs_file&abclow., formats=0,cnvtmls=0) ; if _n_=1 then do; list; put / _all_; end; run; /*<=========================Comment out===================================== proc datasets library=stf902; modify usAtabs_filec; Index create State; modify usBtabs_filec; Index create State; Index create chariter; quit; options obs=max; ods html file="&pgm..html"; proc freq data=stf902.usbtabs_filec(keep=chariter slvl state); table state*(slvl chariter)/list nopercent nocum ; format state $state. slvl $sumlevwc. chariter $chariter. ; run; ods html close; ===========================End commented out================================ */