proc print data=ia.empdata noobs;
var JobCode EmpID Salary;
sum Salary;
run;
To request subgroup totals in PROC PRINT, the observations in the data set must be grouped.
The SORT procedure
rearranges the observations in a SAS data set
can create a new SAS data set containing the rearranged observations
can sort on multiple variables
can sort in ascending (default) or descending order
does not generate printed output
treats missing values as the smallest possible value.
Printing Subtotals and Grand Totals
Print the data set grouped by JobCode with a subtotal for the Salary column for each JobCode.
proc sort data=ia.empdata out=work.empdata;
by JobCode;
run;
proc print data=work.empdata;
by JobCode;
sum Salary;
run;
Page Breaks
Use the PAGEBY statement to put each subgroup on a separate page.
proc print data=work.empdata;
by JobCode;
pageby JobCode;
sum Salary;
run;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment