The Little SAS Book, 6th Edition

Book description

A classic that just keeps getting better, The Little SAS Book is essential for anyone learning SAS programming. Lora Delwiche and Susan Slaughter offer a user-friendly approach so that readers can quickly and easily learn the most commonly used features of the SAS language. Each topic is presented in a self-contained, two-page layout complete with examples and graphics. Nearly every section has been revised to ensure that the sixth edition is fully up-to-date. This edition is also interface-independent, written for all SAS programmers whether they use SAS Studio, SAS Enterprise Guide, or the SAS windowing environment. New sections have been added covering PROC SQL, iterative DO loops, DO WHILE and DO UNTIL statements, %DO statements, using variable names with special characters, the ODS EXCEL destination, and the XLSX LIBNAME engine. This title belongs on every SAS programmer's bookshelf. It's a resource not just to get you started, but one you will return to as you continue to improve your programming skills.

Table of contents

  1. Acknowledgments
  2. Introducing SAS Software
  3. About This Book
  4. About These Authors
  5. Chapter 1 Getting Started Using SAS Software
    1. 1.1 The SAS Language
    2. 1.2 SAS Data Sets
    3. 1.3 DATA and PROC Steps
    4. 1.4 The DATA Step’s Built-in Loop
    5. 1.5 Choosing a Method for Running SAS
    6. 1.6 Reading the SAS Log
    7. 1.7 Using SAS System Options
  6. Chapter 2 Accessing Your Data
    1. 2.1 Methods for Getting Your Data into SAS
    2. 2.2 SAS Data Libraries and Data Sets
    3. 2.3 Listing the Contents of a SAS Data Set
    4. 2.4 Reading Excel Files with the IMPORT Procedure
    5. 2.5 Accessing Excel Files Using the XLSX LIBNAME Engine
    6. 2.6 Reading Delimited Files with the IMPORT Procedure
    7. 2.7 Telling SAS Where to Find Your Raw Data
    8. 2.8 Reading Raw Data Separated by Spaces
    9. 2.9 Reading Raw Data Arranged in Columns
    10. 2.10 Reading Raw Data Not in Standard Format
    11. 2.11 Selected Informats
    12. 2.12 Mixing Input Styles
    13. 2.13 Reading Messy Raw Data
    14. 2.14 Reading Multiple Lines of Raw Data per Observation
    15. 2.15 Reading Multiple Observations per Line of Raw Data
    16. 2.16 Reading Part of a Raw Data File
    17. 2.17 Controlling Input with Options in the INFILE Statement
    18. 2.18 Reading Delimited Files with the DATA Step
  7. Chapter 3 Working with Your Data
    1. 3.1 Using the DATA Step to Modify Data
    2. 3.2 Creating and Modifying Variables
    3. 3.3 Using SAS Functions
    4. 3.4 Selected SAS Character Functions
    5. 3.5 Selected SAS Numeric Functions
    6. 3.6 Using IF-THEN and DO Statements
    7. 3.7 Grouping Observations with IF-THEN/ELSE Statements
    8. 3.8 Subsetting Your Data in a DATA Step
    9. 3.9 Subsetting Your Data Using PROC SQL
    10. 3.10 Writing Multiple Data Sets Using OUTPUT Statements
    11. 3.11 Making Several Observations from One Using OUTPUT Statements
    12. 3.12 Using Iterative DO, DO WHILE, and DO UNTIL Statements
    13. 3.13 Working with SAS Dates
    14. 3.14 Selected Date Informats, Functions, and Formats
    15. 3.15 Using RETAIN and Sum Statements
    16. 3.16 Simplifying Programs with Arrays
    17. 3.17 Using Shortcuts for Lists of Variable Names
    18. 3.18 Using Variable Names with Special Characters
  8. Chapter 4 Sorting, Printing, and Summarizing Your Data
    1. 4.1 Using SAS Procedures
    2. 4.2 Subsetting in Procedures with the WHERE Statement
    3. 4.3 Sorting Your Data with PROC SORT
    4. 4.4 Changing the Sort Order for Character Data
    5. 4.5 Printing Your Data with PROC PRINT
    6. 4.6 Changing the Appearance of DataValues with Formats
    7. 4.7 Selected Standard Formats
    8. 4.8 Creating Your Own Formats with PROC FORMAT
    9. 4.9 Writing a Report to a Text File
    10. 4.10 Summarizing Your Data Using PROC MEANS
    11. 4.11 Writing Summary Statistics to a SAS Data Set
    12. 4.12 Producing One-Way Frequencies with PROC FREQ
    13. 4.13 Producing Crosstabulations with PROC FREQ
    14. 4.14 Grouping Data with User-Defined Formats
    15. 4.15 Producing Tabular Reports with PROC TABULATE
    16. 4.16 Adding Statistics to PROC TABULATE Output
    17. 4.17 Enhancing the Appearance of PROC TABULATE Output
    18. 4.18 Changing Headers in PROC TABULATE Output
    19. 4.19 Producing Simple Output with PROC REPORT
    20. 4.20 Using DEFINE Statements in PROC REPORT
    21. 4.21 Creating Summary Reports with PROC REPORT
    22. 4.22 Adding Summary Breaks to PROC REPORT Output
    23. 4.23 Adding Statistics to PROC REPORT Output
    24. 4.24 Adding Computed Variables to PROC REPORT Output
  9. Chapter 5 Enhancing Your Output with ODS
    1. 5.1 Concepts of the Output Delivery System
    2. 5.2 Creating HTML Output
    3. 5.3 Creating RTF Output
    4. 5.4 Creating PDF Output
    5. 5.5 Creating Text Output
    6. 5.6 Customizing Titles and Footnotes
    7. 5.7 Customizing PROC PRINT with the STYLE= Option
    8. 5.8 Customizing PROC REPORT with the STYLE= Option
    9. 5.9 Customizing PROC TABULATE with the STYLE= Option
    10. 5.10 Adding Trafficlighting to Your Output
    11. 5.11 Selected Style Attributes
    12. 5.12 Tracing and Selecting Procedure Output
    13. 5.13 Creating SAS Data Sets from Procedure Output
  10. Chapter 6 Modifying and Combining SAS Data Sets
    1. 6.1 Stacking Data Sets Using the SET Statement
    2. 6.2 Interleaving Data Sets Using the SET Statement
    3. 6.3 Combining Data Sets Using a One-to-One Match Merge
    4. 6.4 Combining Data Sets Using a One-to-Many Match Merge
    5. 6.5 Using PROC SQL to Join Data Sets
    6. 6.6 Merging Summary Statistics with the Original Data
    7. 6.7 Combining a Grand Total with the Original Data
    8. 6.8 Adding Summary Statistics to Data Using PROC SQL
    9. 6.9 Updating a Master Data Set with Transactions
    10. 6.10 Using SAS Data Set Options
    11. 6.11 Tracking and Selecting Observations with the IN= Option
    12. 6.12 Selecting Observations with the WHERE= Option
    13. 6.13 Changing Observations to Variables Using PROC TRANSPOSE
    14. 6.14 Using SAS Automatic Variables
  11. Chapter 7 Writing Flexible Code with the SAS Macro Facility
    1. 7.1 Macro Concepts
    2. 7.2 Substituting Text with Macro Variables
    3. 7.3 Concatenating Macro Variables with Other Text
    4. 7.4 Creating Modular Code with Macros
    5. 7.5 Adding Parameters to Macros
    6. 7.6 Writing Macros with Conditional Logic
    7. 7.7 Using %DO Loops in Macros
    8. 7.8 Writing Data-Driven Programs with CALL SYMPUTX
    9. 7.9 Writing Data-Driven Programs with PROC SQL
    10. 7.10 Debugging Macro Errors
  12. Chapter 8 Visualizing Your Data
    1. 8.1 Concepts of ODS Graphics
    2. 8.2 Creating Bar Charts with PROC SGPLOT
    3. 8.3 Creating Histograms and Density Curves with PROC SGPLOT
    4. 8.4 Creating Box Plots with PROC SGPLOT
    5. 8.5 Creating Scatter Plots with PROC SGPLOT
    6. 8.6 Creating Series Plots with PROC SGPLOT
    7. 8.7 Creating Fitted Curves with PROC SGPLOT
    8. 8.8 Controlling Axes and Reference Lines in PROC SGPLOT
    9. 8.9 Controlling Legends and Insets in PROC SGPLOT
    10. 8.10 Customizing Graph Attributes in PROC SGPLOT
    11. 8.11 Creating Paneled Graphs with PROC SGPANEL
    12. 8.12 Specifying Image Properties and Saving Graphics Output
  13. Chapter 9 Using Basic Statistical Procedures
    1. 9.1 Examining the Distribution of Data with PROC UNIVARIATE
    2. 9.2 Creating Statistical Graphics with PROC UNIVARIATE
    3. 9.3 Producing Statistics with PROC MEANS
    4. 9.4 Testing Means with PROC TTEST
    5. 9.5 Creating Statistical Graphics with PROC TTEST 258
    6. 9.6 Testing Categorical Data with PROC FREQ
    7. 9.7 Creating Statistical Graphics with PROC FREQ
    8. 9.8 Examining Correlations with PROC CORR
    9. 9.9 Creating Statistical Graphics with PROC CORR
    10. 9.10 Using PROC REG for Simple Regression Analysis
    11. 9.11 Creating Statistical Graphics with PROC REG
    12. 9.12 Using PROC ANOVA for One-Way Analysis of Variance
    13. 9.13 Reading the Output of PROC ANOVA
  14. Chapter 10 Exporting Your Data
    1. 10.1 Methods for Exporting Your Data
    2. 10.2 Writing Delimited Files with the EXPORT Procedure
    3. 10.3 Writing Delimited Files Using ODS
    4. 10.4 Writing Microsoft Excel Files with the EXPORT Procedure
    5. 10.5 Writing Microsoft Excel Files Using ODS
    6. 10.6 Writing Raw Data Files with the DATA Step
  15. Chapter 11 Debugging Your SAS Programs
    1. 11.1 Writing SAS Programs That Work
    2. 11.2 Fixing Programs That Don’t Work
    3. 11.3 Searching for the Missing Semicolon
    4. 11.4 Note: INPUT Statement Reached Past the End of a Line
    5. 11.5 Note: Lost Card
    6. 11.6 Note: Invalid Data
    7. 11.7 Note: Missing Values Were Generated
    8. 11.8 Note: Numeric Values Have Been Converted to Character (or Vice Versa)
    9. 11.9 DATA Step Produces Wrong Results but No Error Message
    10. 11.10 Error: Invalid Option, Error: The Option Is Not Recognized, or Error: Statement IsNot Valid
    11. 11.11 Note: Variable Is Uninitialized or Error: Variable Not Found
    12. 11.12 SAS Truncates a Character Variable
    13. 11.13 Saving Memory or Disk Space
  16. Index

Product information

  • Title: The Little SAS Book, 6th Edition
  • Author(s): Lora D. Delwiche, Susan J. Slaughter
  • Release date: October 2019
  • Publisher(s): SAS Institute
  • ISBN: 9781642953435