x cd /mscdc/data/stf903/Tools; %let pgm=xpt_sl090; filename pgm "&pgm..sas"; *--Convert xpt versions of slvl090 datasets to regular sets and create indices for them--; *--edited to skip conversion and instead just rebuild the special multi-level indexes needed to access the data in geocode order--; x cd /mscdc/data/stf903/slvl090.bystate; libname sl090 '/mscdc/data/stf903/slvl090.bystate'; %macro doit(stab,cnvt=0,index=1); %*--Note defaults for this run: Do NOT convert, but DO generate special index--; %if &cnvt %then %do; data _null_; rc=system("unzip /mscdc/data/stf903/sl090xpt/&stab.sl090.zip"); rc=system("ls -l &stab.sl090.xpt"); if rc > 0 then abort; run; libname sl090x xport "&stab.sl090.xpt"; data sl090.&stab.sl090; set sl090x.&stab.sl090 end=last; if last then put county= _n_=; run; %end; %if &index %then %do; proc datasets library=sl090; modify &stab.sl090; index create sl90=(county cousubfp placefp tract aianafp artli urbarea urbanrur cd bg); run; %end; %if &cnvt %then %do; libname sl090x clear; x rm -f &stab.sl090.xpt; %end; %mend doit; options mprint; %doit(al,cnvt=0,index=1); /* *<=====================Comment Begin===================== %doit(mn,cnvt=1,index=1); %doit(ar) ; %doit(az) ; %doit(ca) ; %doit(co); %doit(ia); %doit(id); %doit(ms); %doit(nc); =========================Comment End====================== */