You can use the MEANS
procedure to analyze the annual salary data that you have retrieved
from the information map. For the purpose of this example, you will
use a DATA step to apply a filter to view only the data for the employees
in the Host Systems Development Division. You will then use the MEANS
procedure to analyze the annual salary data for the mean, the minimum,
and the maximum salaries for each job code in the division. And, finally,
a report is produced with ODS (Output Delivery System).
The following code
analyzes the data and produces an ODS report:
/* Use a filter to create a data set that contains only data */
/* for the Host Systems Development division. */
data work.HRinfo;
set HR_Data."Employee Info"n(filter="Host Systems Development"n);
keep jobcode "Annual Salary"n;
run;
/* Produce an ODS report. */
ods html body="example_body.htm";
/* Analyze the annual salary distribution data. */
proc means data=work.HRinfo maxdec=0;
var "Annual Salary"n;
class jobcode;
title "Annual Salary by Job Code in Host Systems Development Division";
run;
/* Close ODS output. */
ods html close;
Log for the DATA Step and the MEANS Procedure
147 /* Use a filter to create a data set that contains only data */
148 /* for the Host Systems Development division. */
149 data work.HRinfo;
150 set HR_Data."Employee Info"n(filter="Host Systems Development"n);
151 keep jobcode "Annual Salary"n;
152 run;
NOTE: There were 21 observations read from the data set HR_DATA.'Employee Info'n.
NOTE: The data set WORK.HRINFO has 21 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.39 seconds
cpu time 0.07 seconds
153
154 /* Produce an ODS report. */
155 ods html body="example_body.htm";
NOTE: Writing HTML Body file: example_body.htm
156
157 /* Analyze the annual salary distribution data. */
158 proc means data=work.HRinfo maxdec=0;
159 var "Annual Salary"n;
160 class jobcode;
161 title "Annual Salary by Job Code in Host Systems Development Division"
161! ;
162 run;
NOTE: There were 21 observations read from the data set WORK.HRINFO.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds
163
164 /* Close ODS output. */
165 ods html close;
Output from the MEANS Procedure
Annual Salary by Job Code in Host Systems Development Division
The MEANS Procedure
Analysis Variable : Annual Salary Physical column SALARY
Physical
column N
JOBCODE Obs N Mean Std Dev Minimum Maximum
-------------------------------------------------------------------------------------
HSD001 1 1 30000 . 30000 30000
HSD002 4 4 39625 11940 27000 55000
HSD003 1 1 29000 . 29000 29000
HSD004 3 3 47667 20108 31000 70000
HSD005 2 2 57500 3536 55000 60000
HSD006 1 1 120000 . 120000 120000
HSD007 4 4 65750 9777 57000 79000
HSD008 5 5 61000 18990 45000 93500
-------------------------------------------------------------------------------------
The report that is
produced by ODS should look similar to the following:
Report Displayed in the Results Viewer