Understanding SAS Report-Writing Tools

Most SAS procedures produce output in a standard format. Two procedures, REPORT and TABULATE, allow some customization of output layout. DATA steps and ODS features provide the most flexibility in customizing and selecting report output. The examples in this book focus on the application of report-writing procedures, DATA steps, and ODS in producing reports.

When writing a program to create a report, you need to know which SAS procedures specialize in the kind of report you want to produce. Reports can be categorized as detail, summary, customized, and multipanel. Examples of each are shown in Figures 1.1 through 1.4.

Figure 1.1. Example of a Detail Report


Figure 1.2. Example of a Summary Report


Figure 1.3. Example of a Customized Report
									                              Study Heights and Weights
 Group A Males
 Mean Weight: 169  Mean Height: 69.5
 Group B Males
 Mean Weight: 169  Mean Height: 69.5
 TTest Results: Males Group A vs Group B Weight: No significant difference (p>0.05)
 TTest Results: Males Group A vs Group B Height: No significant difference (p>0.05)

 Group A Females
 Mean Weight: 144  Mean Height: 64.6
 Group B Females
 Mean Weight: 139  Mean Height: 65.9
 TTest Results: Females Group A vs Group B Weight: No significant difference (p>0.05)
 TTest Results: Females Group A vs Group B Height: Significant difference (p < 0.05)

Figure 1.4. Example of a Multipanel Report


Detail reports list information at the observation level of a data set (see Figure 1.1).
Summary reports summarize observations and produce output such as frequency counts and descriptive statistics (see Figure 1.2).
Customized reports list information in a style that is different than the standard output from a SAS procedure. Often these are produced with DATA step programming (see Figure 1.3).
Multipanel reports present multiple rows of information side-by-side (see Figure 1.4).

Some overlap does exist between the categories. For example, a detail report may include summaries, and a multipanel report may contain detail and summary information.

Table 1.2 presents an overview of each category of report and the SAS procedures best suited to produce reports of that type.

Table 1.2. Report Types and the Procedures Used to Produce the Different Types
Report TypeProcedure/StepDescription
DetailPRINTProduces data listings quickly; can supply titles, footnotes, and column sums.
REPORTOffers more control and customization than PROC PRINT; can produce both column and row sums; has DATA step computation abilities.
SQLCombines Structured Query Language and SAS features such as formats; can manipulate data and create a SAS data set in the same step that creates the report; can produce column and row statistics; does not offer as much control over output as PROC PRINT and PROC REPORT.
MEANS, SUMMARY, UNIVARIATEComputes descriptive statistics for numeric variables; can produce a printed report and create an output data set.
SummaryPRINTProduces only one summary report; can sum the BY variables.
REPORTCombines features of the PRINT, MEANS, and TABULATE procedures with features of the DATA step in a single report-writing tool; can also create an output data set.
SQLComputes descriptive statistics for one or more SAS data sets or DBMS tables; can produce a printed report or create a SAS data set.
TABULATEProduces descriptive statistics in a tabular format; can produce multidimensional tables with descriptive statistics; can also create an output data set.
CustomizedDATA StepProduces highly customized reports of all types using SAS programming statements.
MultipanelAll procedures when sending output to a nonlisting destination; REPORT when sending output to either the LISTING or a nonlisting destinationProduces side-by-side reports.

Most examples in this book use PROC REPORT and PROC TABULATE. A few examples use PROC PRINT and a few examples use DATA steps. One example uses PROC MEANS and another uses PROC FREQ. PROC FORMAT is used throughout to add labels and other information to the reports.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.78.30