x cd /pub/data/cbp/Tools; %let pgm=fix_formats; filename pgm "&pgm..sas"; libname cbp '/pub/data/cbp'; title "Fix format codes for industry variable"; %macro doyears(startyr,endyr); proc datasets nolist library=cbp; %do iyear=&startyr %to &endyr; %let yy=%substr(&iyear,3,2); %*-----------------------------SPECIAL RUN: we use proc datasets, modify to change the format code for industry (naics name) var--; modify ustots&yy; format industry $naic02_.; modify states&yy; format industry $naic02_.; modify uscos&yy; format industry $naic02_.; %end; %*--of do iyear loop---; %mend doyears; %doyears(2003,2006) run;