A: This task got a lot easier when SAS introduced the output
delivery system (ODS). Example code is given below. The input data
set contains the weight (in pounds) of various people from two different
countries. The output data set contains the mean and median weight for
each country. (Other summary statistics, provided they are available through
PROC MEANS, could be generated as well.)
data people;ODS works with every SAS procedure and is a useful way to process, screen, and format your output before you look at it or paste it into a table. For an introduction to the output delivery system, see the SAS documentation.
input country $ person $ weight;
datalines;
usa FatAlbert 2000
usa WeirdHarold 80
gaul Asterix 50
gaul Obelix 500
;
run;proc means data=people mean;
ods output Summary=country_means;
class country;
run;proc print data=country_means;
run;