x cd /pub/data/acs/Tools; %let pgm=countvartypes; filename pgm "&pgm..sas"; proc contents data=acs2015.usmcdcprofiles noprint out=contents(keep=name type where=(type=1)); run; data vartypes; set contents end=last; name=lowcase(name); if name=:'pct' then npcts+1; else if index(name,'_moe') then nmoes+1; else nvars+1; if last then put _all_; run; **We ran this interactively and the results were: npcts=307 nmoes=362 nvars=364 ;