x cd /pub/sas/formats/Tools; %let pgm=gendese_distsch; filename pgm "&pgm..sas"; *--generate the Sdesedst and Sdesesch format modules using latest coredata sets.--; *---jgb, 10-6-10---; %libname(coredata); filename fmtlib '/pub/sas/formats'; %macro filter; where year='1011'; %mend filter; options mprint; filename text '/pub/sas/formats/Sdesedst.sas'; %genfmat(fmatname=desedst, argvars=distcode,arglen=6,labellen=64, labelvar=distname, runproc=0, slctedit=filter, keepvars=year, setin=coredata.district); options nomprint; filename text clear; filename text '/pub/sas/formats/Sdesesch.sas'; %genfmat(fmatname=desesch, argvars=distcode schnum, arglen=10,labellen=64, labelvar=schlname, runproc=0, slctedit=filter, keepvars=year, setin=coredata.building); run; *---And now compile the 2 source modules to create the catalog entries---; libname sasctlgs clear; libname sasctlgs '/pub/sas/catalogs'; %include fmtlib(Sdesedst.sas)/NOsource2; %include fmtlib(Sdesesch.sas)/NOsource2; run; *--test it--; data _null_; distcode='001090'; put distcode= $desedst.; building='0010901050'; put building= $desesch.; run;