x cd /pub/sas/formats/Tools; %let pgm=gencousub; filename pgm "&pgm..sas"; *--generate the $cousub format code using sf32000x.usmcds and the genfmat macro--; filename text '/pub/sas/formats/Scousub.sas'; %libname(sf32000x); %macro filter; areaname=trim(areaname)||', '||put(county,$county.); %mend filter; options nomprint; %genfmat(fmatname=cousub, arg=geocode, label=_label, procstmt=0, slctedit=filter, keepvars=county, setin=sf32000x.usmcds) *--test it--; data _null_; set sf32000x.moi(where=(sumlev='060' and county='29019')); put geocode areaname geocode $cousub.; run;