Previous Page | Next Page

Example: Using the INFOMAPS Procedure and the Information Maps Engine

Step 8: Analyze the Data in SAS and Produce an ODS Report

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 will be produced with ODS (Output Delivery System).

The following code analyzes the data and produces an ODS report:

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";
run;
ods html close;

Log for the DATA Step and the MEANS Procedure

127  data work.HRinfo;
128  set HR_Data."Employee Info"n(filter="Host Systems Development"n);
129  keep jobcode "Annual Salary"n;
130  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           4.73 seconds
      cpu time            0.10 seconds

131
132  /* Produce an ODS report. */
133  ods html body="example-body.htm";
NOTE: Writing HTML Body file: example-body.htm
134  /* Analyze the annual salary distribution data. */
135  proc means data=work.HRinfo maxdec=0;
136             var "Annual Salary"n;
137             class jobcode;
138             title "Annual Salary by Job Code";
139  run;

NOTE: There were 21 observations read from the data set WORK.HRINFO.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.39 seconds
      cpu time            0.10 seconds

140  ods html close;

Output from the MEANS Procedure

                                       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

[Report produced by ODS]

Previous Page | Next Page | Top of Page