x cd /mscdc/data/stf903/Tools; %let pgm=spltus; filename pgm "&pgm..sas"; %put &pgm; *---Use spltsas macro to partition the national stf3 file ("stf3c")--; title "SPLTSTAT Run to Split STF903 us Data Set Into Smaller Subsets"; libname temp '/tmp/gaussian'; /* *<========================comment out========================= *<--------step 1: create data with new set names----------; proc format; value $sname '010','020','030'='regdiv' '040'='states' '050'='cntys' '061','062'='mcds' '161'='places' '300','310','301','311'='metros' '400','410'='urbas' '440'='l440' '450=''l450' other='other'; *<====we allowed for summary levels 400, 410, 440, 450 but we did not include them on our orginal us.ssd01 set (we separated them to save space) so there will be not usurbas data set created; run; data temp.spltus; set stf903.us; by slvl notsorted; length setname $8; label setname='SAS Data Set Name'; retain setname "us"; if first.slvl then do; *--we assign set via format --; substr(setname,3)=put(slvl,$sname.); end; run; ==========================end comment====================== */ options nocenter ls=128 ps=60; TITLE2 'Freq Tables Show SLVL Values and Counts By Data Set'; proc freq data=temp.spltus(keep=setname slvl); table slvl*setname/nopercent norow nocol; format slvl $slvlwc.; run; options nomprint; *<---------step 2: invoke the macro to partition the data set---; %spltsas(setin=temp.spltus, pathout=%str(/mscdc/data/stf903), genindex=0, /* turn off for rerun */ setvar=setname) *---create additional index by state for counties and places--; proc datasets library=stf903 nolist; modify uscntys; index create state; modify usplaces; index create state; run;