
This is the exact same dataset we used in the previous section. We are going to display the data using the PROC REPORT function.
PROC REPORT DATA=Perf;
COLUMN Agent Q1 Q2 Q3 Q4;
DEFINE Agent / display “AGENT” width=6;
DEFINE Q1 / display “FIRST QUARTER” width=14;
DEFINE Q2 / display “SECOND QUARTER” width=14;
DEFINE Q3 / display “THIRD QUARTER” width=14;
DEFINE Q4 / display “FOURTH QUARTER” width=14;
RUN;


(1) COLUMN statements list out all of the variables to be displayed in the output. In our example, we have 5 variables: Agent and the performance from each quarter.
(2) DEFINE statement defines the properties of how the variables should be displayed.
(3) DISPLAY tells SAS to just display the content of the variable. Other options here include: GROUP, ANALYSIS, COMPUTED, ORDER and ACROSS.
(4) The text within the quotation (e.g. “FIRST QUARTER”) is the label of the variable displayed.
(5) WIDTH assigns the length for each column. This control how the table will look like.
The report still doesn’t look too good. Fortunately, PROC REPORT allows more customization on how the data can be presented. We are going to add 2 commands to our codes above :
PROC REPORT DATA=Perf NOWINDOWS HEADLINE ;
COLUMN Agent Q1 Q2 Q3 Q4;
DEFINE Agent / display “AGENT” width=6;
DEFINE Q1 / display “FIRST QUARTER” width=14;
DEFINE Q2 / display “SECOND QUARTER” width=14;
DEFINE Q3 / display “THIRD QUARTER” width=14;
DEFINE Q4 / display “FOURTH QUARTER” width=14;
RUN;


(2) HEADLINE statement adds a divider between the variable title and the content.
DONE! You have learned the PROC REPORT procedure in SAS!
Note:
- There are a lot more options in PROC REPORT that allow for a far more customized report to be displayed. More details on PROC REPORT will be explained in PART II of this training material.