x cd /pub/sas/formats/Tools; %let pgm=genmable12fmats; filename pgm "&pgm..sas"; *--generate a series of format codes used by the mabel12 sas app. The source code modules get stored in mable12/sasfmats and the compiled formats (for now, at least) in mable12.formats . There is something strange happening in geocorr12.sas. We had a situation where $cousub for state of TN was not working. Until we tweaked this code to store the $cousub. format code in sasctlgs. After that it worked. Speculate that we had an old version of $cousub in sasctlgs that was getting used in spite of the fmtsearch options specified. ?? ---*; %let fmtpath=%str(/pub/data/mable12/sasfmats); %libname(sf12010x); libname sf1x (sf12010x); libname mable12 '/pub/data/mable12'; ; libname georef '/pub/data/georef' access=readonly; libname user '/SAS_temp/userb'; options fmtsearch=(mable12 work sasctlgs); /* ========================begin comment==================================== ==========================end comment====================================== */ *----Create a series of datasets by extracting from a concatentation of all the XXinventory sf12010x sets---; %**let stab=al; data county cousub place school ; set %macro setref(state,stab); sf1x.&stab.selectedinv(keep=_char_) %mend setref; %dostates(n=51,mac=setref) ; ***sf1x.&stab.selectedinv(keep=_char_) ; where sumlev in ('040','050','060','160','950','960','970'); keep STATE county esriid areaname; format county $5.; select (sumlev); when ('040','050') output county; when('060') output cousub; when('160') output place; ***when('320') output cbsa; when('950','960','970') if substr(esriid,3,5) ne '99999' then output school; otherwise abort abend; end; run; %*let f=county; %macro gf(f,argl,sl); %*--this macro accesses one of the temp geo datasets just created and uses it as input to the genfmat utility macro which generates both source and catalog versions of the format for each of several geographic levels with values as reported on SF1, 2010 census. ---; filename text "&fmtpath./S&f..sas"; %macro filter; **areaname=trim(areaname)||', '||put(county,$county.); %mend filter; options nomprint; libname sasctlgs clear; libname sasctlgs '/pub/sas/catalogs'; %genfmat(fmatname=&f, fmatlib= mable12, arg=esriid, arglen=&argl, labelvar=areaname, setin=&f) *--test it--; options fmtsearch=(mable12); data _null_; set sf1x.akselectedinv(where=(sumlev="&sl") ); put esriid +2 esriid $&f.. ; n+1; if n >= 20 then stop; run; %mend gf; *---we found a problem with 3 new county equivs in state 02 (Alaska): 02195, 02198 and 02275. Source code looks OK but mable12 was not displaying properly. We recompiled $county in sasfmats, storing in v9/sasctlgs and it now seems to work. But we recompile the mable12 version just to be sure.--; %**gf(county,5,050); proc format library=mable12; %include '/pub/data/mable12/sas/formats/Scounty.sas'; run; *--interactively 8-21-14--; %**gf(cousub,10,060) ; *--Problem with the cousub format, at least in Tennessee. Rerunning--; %**gf(place,7,160); %**gf(school,7,950); /* ========================begin comment==================================== *---Now do the new Urban Areas and PUMA code names as processed via download in summer 2012 and stored in georef sets--; filename text "&fmtpath./Spuma.sas"; %genfmat(fmatname=puma,fmatlib=mable12, arg=geocode,arglen=7, labellen=96, setin=georef.uspumas2012); filename text "&fmtpath./Suauc.sas"; %genfmat(fmatname=uauc,fmatlib=mable12, arg=UA,arglen=5, labellen=96, setin=georef.usuas2012); ==========================end comment====================================== */