x cd /pub/data/sf12000/Tools; %let pgm=query1_agersexh; filename pgm "&pgm..sas"; *---For James Roach, North County Journal (via D.P.) 7-24-01 User wants: Pop Counts of Persons under and over 50 yrs of age by census tract, St. Louis county. As machine readable file. Strategy: Aggregate cells on the agersexh data set and write file with %cnvtdlm macro. ---*; title 'query1_agersexh: Pull Age Cohort Counts by Tract in St. Louis County'; libname sf1 '/pub/data/sf12000'; libname user '/tmp/storage/john'; filename dlmout '/pub/data/temp/agecounts.csv'; data aggin; set sf1.moagersexh; where county='29189' and race=' ' and hispanic=' '; *<---total pop summaries for St. Louis county-; if age lt 50 then under50=persons; else over50=persons; keep tract under50 over50 Persons; run; proc summary data=aggin; class tract; var under50 over50 Persons; output out=aggout(drop=_type_ _freq_) sum=; run; proc print data=aggout; run; %cnvtdlm(setin=aggout,names=1) data _null_; infile dlmout obs=40; input; put _infile_; run;