The SAS Programmer's PROC REPORT Handbook: Basic to Advanced Reporting Techniques

Book description


The SAS Programmer's PROC REPORT Handbook: Basic to Advanced Reporting Techniques is intended for programmers of all skill levels. Learn how to link multiple reports, add graphics and logos, and manipulate table of contents values to help refine your programs, macrotize where possible, troubleshoot easily, and get great-looking reports every time. From beginner to advanced, the examples in this book will help you harness all the power and capability of PROC REPORT.

With dozens of useful examples, this book is completely unique in three ways. First, this book describes the default behavior of table of contents nodes and labels, and how to change the nodes inside of PROC REPORT. The chapter also explains how to use PROC DOCUMENT in conjunction with PROC REPORT. Secondly, an entire chapter is dedicated to the troubleshooting of errors, warnings, and notes that are produced by PROC REPORT, including explanations of what generated the log message and how to avoid it. Third, the book explains how to preprocess your data in order to get the best output from PROC REPORT, and it explores reports that require multiple steps to create. Whether you work in banking/finance, pharmaceuticals, the health and life sciences, or government, this handbook is sure to be your new favorite reporting reference.

Table of contents

  1. About this Book
  2. About the Author
  3. Acknowledgments
  4. Preface
  5. Chapter 1: Syntax – How to Use Statements and Their Options
  6. 1.1 Introduction
  7. 1.2 PROC REPORT Statement
    1. 1.2.1 General Options
    2. 1.2.2 Report Contents Options
    3. 1.2.3 Report Appearance Options
  8. 1.3 COLUMN Statement
  9. 1.4 DEFINE Statement
    1. 1.4.1 Usage Options
    2. 1.4.2 Interaction Options
    3. 1.4.3 Appearance Options
    4. 1.4.4 Utility Options
  10. 1.5 BREAK Statement
  11. 1.6 RBREAK Statement
  12. 1.7 COMPUTE Statement
  13. 1.8 ENDCOMP Statement
  14. 1.9 CALL DEFINE Statement
    1. 1.9.1 Argument 1: Column-ID
    2. 1.9.2 Argument 2: Attribute Name
    3. 1.9.3 Argument 3: Attribute Value
  15. 1.10 LINE Statement
  16. 1.11 Global Statements
  17. Chapter 2: Concepts – How PROC REPORT Works Behind the Scenes
  18. 2.1 Introduction
  19. 2.2 General Execution
  20. 2.3 Compute Blocks
    1. 2.3.1 COMPUTE Statement
    2. 2.3.2 Execution of Compute Blocks
  21. 2.4 Referencing Report-items
  22. 2.5 Left to Right Availability
  23. 2.6 Repeating GROUP or ORDER Variable Values
    1. 2.6.1 Character Variables
    2. 2.6.2 Numeric Variables
    3. 2.6.3 Undesired Repeating Values
  24. 2.7 Column Widths
  25. 2.8 Date Variables
  26. 2.9 Temporary Variables
  27. 2.10 Sorting and the ORDER= Option
  28. 2.11 Paging
  29. Chapter 3: Examples – How to Get the Desired Report
  30. 3.1 Introduction
  31. 3.2 Standard Reports
    1. 3.2.1 Create a Basic Report
    2. 3.2.2 Define a Variable as ORDER
    3. 3.2.3 Define a Variable as GROUP
    4. 3.2.4 Create a New Report-Item
    5. 3.2.5 Produce Summary Rows
  32. 3.3 Nonstandard Reports
    1. 3.3.1 Calculate Percentages within Groups
    2. 3.3.2 Customized Sort Order
    3. 3.3.3 Multiple Summary Rows at One Location
    4. 3.3.4 Rows Created with a LINE Statement Versus a BREAK Statement
    5. 3.3.5 Conditionally Display a LINE Statement
  33. 3.4 Special Data Consideration Reports
    1. 3.4.1 Wide Tables
    2. 3.4.2 Using ORDER=DATA
    3. 3.4.3 Using the COMPLETEROWS Option
    4. 3.4.4 Output a Table with No Data
    5. 3.4.5 Dynamically Assign Spanning Header Text
  34. Chapter 4: Examples – How to Use ACROSS Variables
  35. 4.1 Introduction
  36. 4.2 Standard Reports
    1. 4.2.1 Stack a Statistic
    2. 4.2.2 Multiple Variables under an ACROSS Variable
    3. 4.2.3 A DISPLAY Variable under an ACROSS Variable
    4. 4.2.4 A GROUP Variable under an ACROSS Variable
    5. 4.2.5 Create New Report-Items
    6. 4.2.6 Percentages
  37. 4.3 Header Section Rows
    1. 4.3.1 Default Header Section Created with ACROSS
    2. 4.3.2 Place a Spanning Header beside ACROSS Values
    3. 4.3.3 Place Spanning Headers beside ACROSS Label
    4. 4.3.4 Place Multiple Spanning Headers beside ACROSS Header Rows
    5. 4.3.5 Remove ACROSS Label Row
    6. 4.3.6 Counts As Part of ACROSS Values
  38. 4.4 Nonstandard Reports
    1. 4.4.1 Customized Sort Order
    2. 4.4.2 Creating Subtotal Columns
    3. 4.4.3 Nesting ACROSS Variables
    4. 4.4.4 Hide a Column under an ACROSS
    5. 4.4.5 Vertical Page Breaks
    6. 4.4.6 Use Macro to Create Column References
  39. Chapter 5: Examples – How to Determine When to Pre-Process the Data
  40. 5.1 Introduction
  41. 5.2 Sort by Statistic
    1. 5.2.1 Grouped Report, No ACROSS Variable
    2. 5.2.2 Grouped Reports with an ACROSS Variable
  42. 5.3 Use COMPLETEROWS with ACROSS
    1. 5.3.1 COMPLETEROWS and a GROUP Variable under an ACROSS Variable
    2. 5.3.2 COMPLETEROWS and a DISPLAY Variable under an ACROSS
  43. 5.4 Use COMPLETEROWS with Multiple GROUP Variables
  44. 5.5 Use Information from a Variable in Header and Data Sections
  45. 5.6 Wrap Text at a Specific Place
  46. 5.7 Incorporate Various Data Pieces into One Report
    1. 5.7.1 Combine Detail and Summary Information
    2. 5.7.2 The Importance of ORDER Variables
  47. 5.8 Create the Look of Merged Cells
    1. 5.8.1 Merge Vertically
    2. 5.8.2 Merge Horizontally
  48. Chapter 6: Styles – How to Change a Report’s Appearance
  49. 6.1 Introduction
  50. 6.2 STYLE= Option
  51. 6.3 Borders
    1. 6.3.1 FRAME= and RULES= Attributes
    2. 6.3.2 Column (Data) Borders
    3. 6.3.3 Header Borders
  52. 6.4 Trafficlighting
    1. 6.4.1 Color Based on Cell’s Value
    2. 6.4.2 Color Based on Another Report-item
    3. 6.4.3 Color on the Diagonal
  53. 6.5 Trafficlighting under an ACROSS Variable
    1. 6.5.1 Color Based on Cell’s Value
    2. 6.5.2 Color Based on Another Report-item
    3. 6.5.3 Color on the Diagonal
  54. 6.6 Color in Headers
    1. 6.6.1 STYLE(HEADER)= on PROC REPORT Statement
    2. 6.6.2 STYLE(HEADER)= on DEFINE Statement
    3. 6.6.3 Spanning Header
    4. 6.6.4 ACROSS Variable Label and Value Headers
    5. 6.6.5 ACROSS Value Headers
    6. 6.6.6 ACROSS Label versus ACROSS Values
  55. 6.7 LINE Statements
  56. 6.8 Advanced Color and Border Assignments
    1. 6.8.1 Apply Multiple Styles on One Cell
    2. 6.8.2 Color Every Other Row
    3. 6.8.3 Change Borders in HTML Output
    4. 6.8.4 Special Instructions for the ODS Destination
  57. 6.9 Images
    1. 6.9.1 Place an Image above or below a Report Table
    2. 6.9.2 Place an Image inside of the Table
  58. 6.10 URLs
    1. 6.10.1 Hyperlink to a Static Location
    2. 6.10.2 Link to Numerous Files
  59. Chapter 7: Table of Contents – How to Manipulate with CONTENTS= and PROC DOCUMENT
  60. 7.1 Introduction
  61. 7.2 Default Nodes
  62. 7.3 BY-Variable Nodes
  63. 7.4 DEFINE Statement CONTENTS=
  64. 7.5 BREAK Statement CONTENTS=
  65. 7.6 RBREAK Statement CONTENTS=
  66. 7.7 ODS DOCUMENT and PROC DOCUMENT
    1. 7.7.1 ODS DOCUMENT Convention
    2. 7.7.2 PROC DOCUMENT Statements and Options
    3. 7.7.3 Default Items
    4. 7.7.4 BY-Variable Item List
    5. 7.7.5 Parent Node with Multiple Child Nodes
    6. 7.7.6 Combine Multiple PROC REPORT Steps under One Node
  67. Chapter 8: Debugging Techniques – How to Troubleshoot
  68. 8.1 Introduction
  69. 8.2 Errors, Warnings, and Notes in the Log
    1. 8.2.1 DEFINE Statement
    2. 8.2.2 BREAK Statement
    3. 8.2.3 Compute Block Statements
  70. 8.3 Temporary Variable Values
    1. 8.3.1 Output via a LINE Statement
    2. 8.3.2 Output via a COMPUTED Variable
  71. 8.4 General Tips
  72. References
  73. Books
  74. Conference Papers
  75. Technical Paper
  76. SAS Documentation
  77. SAS Notes
  78. Index

Product information

  • Title: The SAS Programmer's PROC REPORT Handbook: Basic to Advanced Reporting Techniques
  • Author(s): Jane Eslinger
  • Release date: March 2016
  • Publisher(s): SAS Institute
  • ISBN: 9781629602103