x cd /mscdc/data/stf903/Tools; %let pgm=spltzips; filename pgm "&pgm..sas"; %put &pgm; *---split the full u.s. zip (stf903b) data set into a collection of data sets, 1 per state. Also, create county indices for mo, ks, il sets---; * libname ustf903 '/unitree/mscdc/data/stf903'; libname ustf903 '/tmp/gaussian/nguyenj'; *<--moved from unitree here by john nguyen while working on fix to unitree--; data uszips; set ustf903.zipsus; retain setname ' zips'; if stab='##' then do; if state='12' then stab='FL'; else if state='21' then stab='KY'; else if state='29' then stab='MO'; *<---3 bad cases found--; end; substr(setname,1,2)=stab; if state="'9" then if stab='AK' then do; state='02'; cnty='999'; county='02999'; fipco=county; end; if msacmsa="''" then msacmsa=" "; *<---fix bug--; run; proc freq data=uszips(keep=slvl setname); table slvl*setname/nopercent nocum norow nocol; run; %spltsas(setin=uszips, pathout=%str(/mscdc/data/stf903), setvar=setname,dropsvar=1, genindex=1) *--Note -- step to create these indices bombed on batch run but was fixed and ran interactively--; proc datasets ddname=stf903; modify mozips; index create county; modify ilzips; index create county; modify kszips; index create county; quit; x ls -l /mscdc/data/stf903; run;