data Georgia; set sashelp.zipcode(where=(StateName="Georgia")); if msa=0 then msa=.; run; proc freq data=georgia; tables CountyNm / out=Counties noprint; tables AreaCode / out=AreaCodes noprint; tables ZIP_Class / out=ZIPclasses noprint; tables MSA / out=MSAs noprint; run; data counts; set Counties(in=county_level) AreaCodes(in=areacode_level) ZIPclasses(in=zipclass_level) MSAs(in=msa_level) end=no_more; if county_level then CountyCount+1; else if areacode_level then AreaCodeCount+1; else if zipclass_level then ZIPclassCount+1; else if msa_level then MSACount+1; if no_more then output; keep CountyCount AreaCodeCount ZIPclassCount MSACount; run; proc print data=counts noobs; title1 "Counts of Variable Levels"; run;