x cd /mscdc/sas/formats/Tools; %let pgm=county; filename pgm "&pgm..sas"; *--generate the $county format code: current county name in mixed-case with state abbreviation in all caps. Uses gics90 as data source--; *--rerun 2-2000 to just recompile edited version--; %libname(gics90); filename text '/mscdc/sas/formats/Scounty.sas'; title 'Generate $county SAS format code'; title 'Recompile Edited $county SAS Format'; /* *<=====================Comment Out======================== *<-----------Editing done 2-2000 to add state name entries and to add entries for new counties (Miami-Dade, FL and several new ones in Alaska. Header code also added. All we do here is rerun the edited code to recreate the format catalog entry----------*; data cnames; set gics90.counties(keep=state county areaname); ic=index(areaname,'County'); if ic then substr(areaname,ic)=' '; areaname=trim(areaname)||' ' ||put(state,$fipstab.); run; %genfmat(sasin=cnames, fmatname=county, argvars=county, arglen=5, labelvar=areaname, labellen=40, runproc=1) run; ==========================End Comment========================*/ proc format library=library; %include text; run; data _null_; infile text obs=50; input; file print; put _infile_; title2 'First 50 Lines of Scounty.sas file'; run; *--test use--*; data _null_; input fipco $5.; put fipco= fipco $county.; datalines; 01 01000 01001 02068 02232 02282 12086 run;