Contents

About This Book

PART 1 SQL Processing with SAS

Chapter 1 • Performing Queries Using PROC SQL

Overview

PROC SQL Basics

Writing a PROC SQL Step

Selecting Columns

Specifying the Table

Specifying Subsetting Criteria

Ordering Rows

Querying Multiple Tables

Summarizing Groups of Data

Creating Output Tables

Additional Features

Summary

Quiz

Chapter 2 • Performing Advanced Queries Using PROC SQL

Overview

Viewing SELECT Statement Syntax

Displaying All Columns

Limiting the Number of Rows Displayed

Eliminating Duplicate Rows from Output

Subsetting Rows by Using Conditional Operators

Subsetting Rows by Using Calculated Values

Enhancing Query Output

Summarizing and Grouping Data

Subsetting Data by Using Subqueries

Subsetting Data by Using Noncorrelated Subqueries

Subsetting Data by Using Correlated Subqueries

Validating Query Syntax

Additional Features

Summary

Quiz

Chapter 3 • Combining Tables Horizontally Using PROC SQL

Overview

Understanding Joins

Generating a Cartesian Product

Using Inner Joins

Using Outer Joins

Creating an Inner Join with Outer Join-Style Syntax

Comparing SQL Joins and DATA Step Match-Merges

Using In-Line Views

Joining Multiple Tables and Views

Summary

Quiz

Chapter 4 • Combining Tables Vertically Using PROC SQL

Overview

Understanding Set Operations

Using the EXCEPT Set Operator

Using the INTERSECT Set Operator

Using the UNION Set Operator

Using the OUTER UNION Set Operator

Comparing Outer Unions and Other SAS Techniques

Summary

Quiz

Chapter 5 • Creating and Managing Tables Using PROC SQL

Overview

Understanding Methods of Creating Tables

Creating an Empty Table by Defining Columns

Displaying the Structure of a Table

Creating an Empty Table That Is like Another Table

Creating a Table from a Query Result

Inserting Rows of Data into a Table

Creating a Table That Has Integrity Constraints

Handling Errors in Row Insertions

Displaying Integrity Constraints for a Table

Updating Values in Existing Table Rows

Deleting Rows in a Table

Altering Columns in a Table

Dropping Tables

Summary

Quiz

Chapter 6 • Creating and Managing Indexes Using PROC SQL

Overview

Understanding Indexes

Deciding Whether to Create an Index

Creating an Index

Displaying Index Specifications

Managing Index Usage

Dropping Indexes

Summary

Quiz

Chapter 7 • Creating and Managing Views Using PROC SQL

Overview

Creating and Using PROC SQL Views

Displaying the Definition for a PROC SQL View

Managing PROC SQL Views

Updating PROC SQL Views

Dropping PROC SQL Views

Summary

Quiz

Chapter 8 • Managing Processing Using PROC SQL

Overview

Specifying SQL Options

Controlling Execution

Controlling Output

Testing and Evaluating Performance

Resetting Options

Using Dictionary Tables

Additional Features

Summary

Quiz

PART 2 SAS Macro Language

Chapter 9 • Introducing Macro Variables

Overview

Basic Concepts

Using Automatic Macro Variables

Using User-Defined Macro Variables

Processing Macro Variables

Displaying Macro Variable Values in the SAS Log

Using Macro Functions to Mask Special Characters

Using Macro Functions to Manipulate Character Strings

Using SAS Functions with Macro Variables

Combining Macro Variable References with Text

Summary

Quiz

Chapter 10 • Processing Macro Variables at Execution Time

Overview

Creating a Macro Variable During DATA Step Execution

Creating Multiple Macro Variables During DATA Step Execution

Referencing Macro Variables Indirectly

Obtaining Macro Variable Values During DATA Step Execution

Creating Macro Variables During PROC SQL Step Execution

Working with PROC SQL Views

Using Macro Variables in SCL Programs

Summary

Quiz

Chapter 11 • Creating and Using Macro Programs

Overview

Basic Concepts

Developing and Debugging Macros

Using Macro Parameters

Understanding Symbol Tables

Processing Statements Conditionally

Processing Statements Iteratively

Using Arithmetic and Logical Expressions

Summary

Quiz

Chapter 12 • Storing Macro Programs

Overview

Understanding Session-Compiled Macros

Storing Macro Definitions in External Files

Storing Macro Definitions in Catalog SOURCE Entries

Using the Autocall Facility

Using Stored Compiled Macros

Summary

Quiz

PART 3 Advanced SAS Programming Techniques

Chapter 13 • Creating Samples and Indexes

Overview

Creating a Systematic Sample from a Known Number of Observations

Creating a Systematic Sample from an Unknown Number of Observations

Creating a Random Sample with Replacement

Creating a Random Sample without Replacement

Using Indexes

Creating Indexes in the DATA Step

Managing Indexes with PROC DATASETS

Managing Indexes with PROC SQL

Documenting and Maintaining Indexes

Summary

Quiz

Chapter 14 • Combining Data Vertically

Overview

Using a FILENAME Statement

Using an INFILE Statement

Appending SAS Data Sets

Additional Features

Summary

Quiz

Chapter 15 • Combining Data Horizontally

Overview

Reviewing Terminology

Working with Lookup Values Outside of SAS Data Sets

Combining Data with the DATA Step Match-Merge

Using PROC SQL to Join Data

Comparing DATA Step Match-Merges and PROC SQL Joins

Combining Summary Data and Detail Data

Using an Index to Combine Data

Using a Transactional Data Set

Summary

Quiz

Chapter 16 • Using Lookup Tables to Match Data

Overview

Using Multidimensional Arrays

Using Stored Array Values

Using PROC TRANSPOSE

Merging the Transposed Data Set

Using Hash Objects as Lookup Tables

Summary

Quiz

Chapter 17 • Formatting Data

Overview

Creating Custom Formats Using the VALUE Statement

Creating Custom Formats Using the PICTURE Statement

Managing Custom Formats

Using Custom Formats

Creating Formats from SAS Data Sets

Creating SAS Data Sets from Custom Formats

Summary

Quiz

Chapter 18 • Modifying SAS Data Sets and Tracking Changes

Overview

Using the MODIFY Statement

Modifying All Observations in a SAS Data Set

Modifying Observations Using a Transaction Data Set

Modifying Observations Located by an Index

Controlling the Update Process

Understanding Integrity Constraints

Placing Integrity Constraints on a Data Set

Documenting Integrity Constraints

Removing Integrity Constraints

Understanding Audit Trails

Initiating and Reading Audit Trails

Controlling Data in the Audit Trail

Controlling the Audit Trail

Understanding Generation Data Sets

Initiating Generation Data Sets

Processing Generation Data Sets

Summary

Quiz

PART 4 Optimizing SAS Programs

Chapter 19 • Introduction to Efficient SAS Programming

Overview

Overview of Computing Resources

Assessing Efficiency Needs at Your Site

Understanding Efficiency Trade-offs

Using SAS System Options to Track Resources

Using Benchmarks to Compare Techniques

Summary

Chapter 20 • Controlling Memory Usage

Overview

Controlling Page Size and the Number of Buffers

Using the SASFILE Statement

Additional Features

Summary

Quiz

Chapter 21 • Controlling Data Storage Space

Overview

Reducing Data Storage Space for Character Variables

Reducing Data Storage Space for Numeric Variables

Compressing Data Files

Using SAS DATA Step Views to Conserve Data Storage Space

Summary

Quiz

Chapter 22 • Using Best Practices

Overview

Executing Only Necessary Statements

Eliminating Unnecessary Passes through the Data

Reading and Writing Only Essential Data

Storing Data in SAS Data Sets

Avoiding Unnecessary Procedure Invocation

Summary

Quiz

Chapter 23 • Selecting Efficient Sorting Strategies

Overview

Avoiding Unnecessary Sorts

Using a Threaded Sort

Calculating and Allocating Sort Resources

Handling Large Data Sets

Removing Duplicate Observations Efficiently

Additional Features

Summary

Quiz

Chapter 24 • Querying Data Efficiently

Overview

Using an Index for Efficient WHERE Processing

Identifying Available Indexes

Identifying Conditions That Can Be Optimized

Estimating the Number of Observations

Comparing Probable Resource Usage

Deciding Whether to Create an Index

Comparing Procedures That Produce Detail Reports

Comparing Tools for Summarizing Data

Summary

Quiz

PART 5 Quiz Answer Keys

Appendix 1 • Quiz Answer Keys

Chapter 1: Performing Queries Using PROC SQL

Chapter 2: Performing Advanced Queries Using PROC SQL

Chapter 3: Combining Tables Horizontally Using PROC SQL

Chapter 4: Combining Tables Vertically Using PROC SQL

Chapter 5: Creating and Managing Tables Using PROC SQL

Chapter 6: Creating and Managing Indexes Using PROC SQL

Chapter 7: Creating and Managing Views Using PROC SQL

Chapter 8: Managing Processing Using PROC SQL

Chapter 9: Introducing Macro Variables

Chapter 10: Processing Macro Variables at Execution Time

Chapter 11: Creating and Using Macro Programs

Chapter 12: Storing Macro Programs

Chapter 13: Creating Samples and Indexes

Chapter 14: Combining Data Vertically

Chapter 15: Combining Data Horizontally

Chapter 16: Using Lookup Tables to Match Data

Chapter 17: Formatting Data

Chapter 18: Modifying SAS Data Sets and Tracking Changes

Chapter 19: Introduction to Efficient SAS Programming

Chapter 20: Controlling Memory Usage

Chapter 21: Controlling Data Storage Space

Chapter 22: Using Best Practices

Chapter 23: Selecting Efficient Sorting Strategies

Chapter 24: Querying Data Efficiently

Index

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

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