x cd /pub/sas/formats/Tools; %let pgm=gen_aianhh; filename pgm "&pgm..sas"; *---Generate $aianhh format code with FIPS code as arg and name as label. These are American Indian, Alaska Native & Hawn Homeland entities. Our source is the 250-level summary on the 2010 SF1 data files. So these codes are vintage 2010. jgb, OSEDA. 11-14-16. ---*; filename text '/pub/sas/formats/Saianhh.sas'; %libname(sf12010); libname user '/SAS_temp/user'; data user.setin; set sf12010.usamindianetc(keep=sumlev areaname aianhh aianhhfp where=(sumlev='250')); if aianhhfp='#####' then aianhhfp='#'||aianhh; *<--do not know what the ###### values signify but lets have a code here-; run; %genfmat(setin= user.setin, fmatname=aianhh, argvars=aianhh,labelvar=areaname,arglen=4, runproc=0); libname sasctlgs clear; libname flib '/pub/sas/catalogs'; *<---under this name we have write access--; proc format library=flib; %include text; run; data _null_; *--test it.--; set setin (obs=10); put aianhhfp= aianhhfp $aianhh.; run;