SAS.Publishing.PROC.REPORT.by.Example.Techniques.for.Building.Professional.Reports.Using.SAS®.Dec.2013.pdf
About This Book
Acknowledgements
Chapter 1: Creating Complementary Reports
Introduction
Example: Department Store Summary and Detail Reports
Goals for Creating Complementary Reports
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation
Create a Setup Program that Contains Common SAS Code
Ch1Setup.SAS
Writing the Detail Report Program
Detail Report Pre-Processing Code
Detail Report: Titles, Footnotes, and ODS RTF Preparation
Code for Titles, Footnotes, and ODS RTF Preparation
Producing the Report with PROC REPORT
Detail Report - PROC REPORT Code
Writing the Summary Report Program
Map Separate Variables/Values to One Column for PROC REPORT
Summary Report - Pre-Processing Code
Assign Report Order to Variables
Code for Creating Ordered Variables
Summary Report: Titles, Footnotes, and ODS RTF Preparation
Code for Titles, Footnotes, and ODS RTF Preparation
Producing the Report with PROC REPORT
Summary Report - PROC REPORT Code
Chapter 1 Summary
Chapter 2: Formatting Highly Detailed Reports
Introduction
Example: Format National Sales Report
Goals for Formatting the National Sales Report
Key Steps
Source Data
ODS Style Template Used
Programs Used
PROC TEMPLATE Program to Create New Style Template
The “Before Formatting” Program (Program 2.1)
Implementation
Transforming Figure 2.1 Into Figure 2.2
Displaying Region as a Line Above Each Report Page
Overview of Region Display
Code to Make the Region Display in Figure 2.3
Displaying Store and Branch Column Data in Bold Blue Font
5
Code for Store and Branch Display
How to Insert Arrows for Quick Reference to Sales Increases/Decreases
Overview on Arrow Insertion
Code for Arrow Insertion
How to Add Spanning Headers, Bottom Cell Borders, and Underlines
Highlights on Adding Spanning Headers, Borders, and Underlines
Code for Adding Spanning Headers, Borders, and Underlines
Adding Blank Columns to Make the Report More Legible
Overview of Adding Blank Columns
Code for Adding Blank Columns
Style: Add a Blank Line After Each Summary Line
Highlights on Styling Summary Line and Adding a Blank Line
Code for Styling Summary Line and Adding a Blank Line
Chapter 2 Summary
Chapter 3: Reporting Different Metrics Within a Column
Introduction
Example: Demographic and Baseline Characteristics Report
Goals for the Demographics and Baseline Characteristics Report
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation
Obtain Population Counts for Column Headers and Denominators
Code for Obtaining Population Counts
Categorical Variables: Obtain Counts and Percentages
Code for Obtaining Categorical Counts and Percentages
Continuous Variables: Descriptive Data
Macro Code for Obtaining Descriptive Statistics
Create Final Table: Combine TABULATE and MEANS Results
Code for Combing the Results
Produce the Report via PROC REPORT
PROC REPORT Code
Chapter 3 Summary
Chapter 4: Lesion Data Quality Report—COMPUTE Blocks
Introduction
Example: Lesion Data Quality Report
Goals for Creating the Lesion Data Quality Report
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation
COMPUTE Block Variables: DATA Step (Temporary) Versus REPORT (COLUMN Statement) Variables
ORDER by and Print Subject ID on Every Row with Greying Font
Program for Subject ID Display
Identify Potential Data Issues
Code for Displaying Potential Data Issues
Final Formatting: Create Spanning Headers
Chapter 4 Summary
Chapter 5: Multi-Sheet Workbook With Histograms—ExcelXP Tagsets Report
Introduction
6
Example: Multi-Sheet Workbook Containing Heart Study Results
Goals for Creating the Multi-Sheet Workbook
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation
Create Formats and Informats
Code for Creating Formats and Informats
Obtain Counts and Percentages
Code for Obtaining Counts and Percentages
Producing the Workbook With PROC REPORT and ODS Tagset
Code for Opening, Closing, and Setting Initial Options for the ExcelXP Workbook
Producing the Specific Worksheets
Code for Producing ByStatusCOL and ByStatusROW Worksheets
Code for Producing ByStatusALL Worksheet
Chapter 5 Summary
Chapter 6: Using the ACROSS Option to Create a Weekly Sales Report
Introduction
Example: Weekly Sales Report
Goals for Creating a Weekly Sales Report
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation: Creating the ODS Style Template
Proc Template Code
Obtain Calendar Grid and Merge With Sales
Produce the Report
Code for Producing the Report
Place Holders for Data Not Yet Available
Chapter 6 Summary
Chapter 7: Embedding Images in a Report
Introduction
Example: Tables Displaying Iris Flower Measurements
Goals for Embedding Images in Reports
Source Data
ODS Style Templates Used
Programs Used
Implementation
Setup Options, File Paths, and Image File Names
Program Setup Code
Example 1: Obtain Images as Column of Data
Code for Obtaining Images as Column of Data
Example 2: Repeated Images Above and Below Table
Code for Repeating Images Above and Below Table
Produce the Report
Example 3: Display Images as Column Headers
Code for Displaying Images as Column Headers
Example 4: Display Image in Page Title
Code for Displaying Images in Page Titles
Example 5: Display Image Above Body of Table
7
Code for Displaying Image Above Body of Table
Example 6: Display Watermark on Report
Chapter 7 Summary
Chapter 8: Combining Graphs and Tabular Data
Introduction
Example: Dashboard Report of Shoe Sales
Goals for Creating the Shoe Sales Dashboard
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation
Create a Summary Data Set using PROC REPORT
Code for Creating a Summary Data Set
Obtain Regional Ranking Information
Code for Obtaining Regional Ranking Information
Create a New ODS Style Template
Create the ODS LAYOUT for the Report
Create Formats Needed for Outputs
Use PROC SGPLOT to Create Vertical Bar Charts
Code for SGPLOT Vertical Bar Charts
Using PROC SGPLOT to Create a Horizontal Bar Chart
Horizontal Bar Chart Code
Using PROC REPORT to Obtain Tabular Output
Using PROC SGPANEL to Create Bar Charts for the Top 3 Regions
Chapter 8 Summary
Chapter 9: Using PROC REPORT to Obtain Summary Statistics for Comparison
Introduction
Example: Vehicle MSRP Comparison Report
Goals for MSRP Comparison Report
Key Steps
Source Data
ODS Style Template Used
Programs Used
Implementation
Initial PROC REPORT for Obtaining Statistics
Code for Obtaining Statistics
Produce the Report
Code for Print Report
Chapter 9 Summary
References
DATA SETS
Index
附件列表