x cd /pub/data/stf901/Tools; %let pgm=cnvt_stf901; filename pgm "&pgm..sas"; *---We adapt code stored in sasmacro/stf901c.sas to do a convert of stf1a data sets. We can also do stf901b sets (block level). Testing with Delaware data downloaded from ftp2.census.gov 6/17. filename maclib '/pub/data/sasmacro'; *--library containing macros and other related modules-; libname stf901 "/pub/data/stf901"; %let state=10; %let stab=de; %let statenm=Delaware; %let ustab=%upcase(&stab); %let subfileG=A; *--this is the global parm which we pass to the macro as value of subfile --; x cd /pub/data/stf901/rawdata; %macro doit(state,stab); %let ustab=%upcase(&stab); *filename in "/pub/data/stf901/rawdata/STF1&subfileG.x&ustab.-F01" termstr=crlf; filename in pipe "unzip -a -p 90STF1A-&ustab..ZIP" ; *--The macro is in /pub/sas/macros/stf901c.sas ---; %stf901c(setout=stf901.&stab.file&subfileG,formats=1,cnvtmls=0,subfile=&subfileG, obsin=, debug=0); %mend doit; options mprint; %doit(10,de);