Book description
Hash objects, an efficient look-up tool in the SAS DATA step, are object-oriented programming structures that function differently from traditional SAS language statements. Michele Burlew's SAS Hash Object Programming Made Easy shows readers how to use these powerful features, which they can program to quickly look up and manage data and to conserve computing resources. SAS provides various look-up techniques, and hash objects are among the newest, so therefore many users may not have yet used them. Because the examples presented vary in complexity, SAS Hash Object Programming Made Easy is useful to SAS users of all experience levels, from novice programmer to advanced programmer. Novice programmers can adapt some of the simpler hash programming techniques as they develop their SAS programming skills. This book helps more experienced programmers learn how to take advantage of hash object programming by comparing traditional processing techniques to those that use hash objects. Additionally, users from diverse fields with different requirements can adapt the examples in SAS Hash Object Programming Made Easy to fit their unique situations.
This book is part of the SAS Press program.
Table of contents
- Contents
- About This Book
- About The Author
- Acknowledgments
- Preface
- Chapter 1: An Overview of Hash Objects
-
Chapter 2: Hash Object Terminology and Concepts
- What Is a SAS Hash Object?
- Defining Terms Associated with Hash Objects
- Writing Code That Works with Hash Objects
- Understanding How SAS Stores Hash Objects in Memory
- Understanding How Long Hash Objects Persist
- Specifying the Contents of Hash Objects
- Initializing Variables in a DATA Step That Contains a Hash Object
- Illustrating How the Program Data Vector Connects DATA Step Variables and Hash Object Items
-
Chapter 3: Basic Hash Object Applications
- Using a Hash Object As a Lookup Table
- Defining a Hash Object
- Finding Key Values in a Hash Object
- Defining the Key Structure in a Hash Object
- Understanding How the FIND and CHECK Methods Alter the Values of DATA Step Variables and Hash Object Data Items
- Application Example: Verifying Presence of Key Values
- Application Example: Returning Data Items from a Hash Object
- Application Example: Defining the Key Value During Processing of the DATA Step
- Application Example: Searching for a Key Value in Multiple Hash Objects
- Application Example: Combining Data from Multiple Sources
- Using Multiple Key Items to Look Up Data
- Traversing Hash Objects
- Specifying a Hash Iterator Object
- Understanding the Methods That Control Traversal of a Hash Object
- Illustrating How the Hash Iterator Object Traverses a Hash Object
- Application Example: Traversing a Hash Object from Beginning to End
- Application Example: Linking Hierarchically Related Data Sets
- Application Example: Performing a Fuzzy Merge Using a Hash Iterator Object
-
Chapter 4: Creating Data Sets from Hash Objects and Updating Contents of Hash Objects
- Creating a Data Set from a Hash Object
- Adding, Modifying, and Removing Data from a Hash Object
- Defining the Key Structure in a Hash Object
- Understanding How to Specify the KEY and DATA Argument Tags
- Identifying the Variables That the OUTPUT Method Writes to a Data Set
- Understanding the Interaction between DATA Step Variables and Hash Object Data Items When Replacing Data in a Hash Object
- Replacing Key Item Values When a Key Item Is Also a Data Item
- Comparing the DATA Statement and the OUTPUT Method
- Application Example: Finding the Unique Values of a Variable in a Data Set
- Application Example: Ordering Observations by Variables Not Saved to a Data Set Created from a Hash Object
- Application Example: Using Hash Objects to Apply Transactions to Master Data Sets—Part 1
- Application Example: Using Hash Objects to Apply Transactions to Master Data Sets—Part 2
- Application Example: Summarizing Data with the Hash Iterator Object
- Application Example: Summarizing Hierarchically Related Data
-
Chapter 5: Hash Objects with Multiple Sets of Data Items per Key Value
- Understanding the Concepts of Duplicate Key Values and Multiple Sets of Data Items per Key Value in a Hash Object
- Defining Hash Objects That Process Multiple Sets of Data Items per Key Value
- Illustrating How the MULTIDATA and DUPLICATE Argument Tags Affect Hash Object Processing
- Understanding the Methods That Look for Multiple Sets of Data Items per Key
- Understanding How SAS Stores Multiple Sets of Data Items per Key
- Comparing Retrieval of Data from a Hash Object That Allows Multiple Sets of Data Items per Key Value to a Hash Iterator Object
- Modifying Data in a Hash Object That Allows Multiple Sets of Data Items per Key Value
- Summarizing Data in Hash Objects That Allow Multiple Sets of Data Items per Key Value
- Application Example: Summarizing and Sorting a Data Set
- Application Example: Creating Data Sets Based on a Series of Observations
- Application Example: Creating a Data Set That Contains All Combinations of Specific Variables When the Number of Combinations Is Large
- Application Example: Linking Hierarchically Related Data Using a Hash Object That Allows Multiple Sets of Data Items per Key Value
-
Chapter 6: Managing Hash Objects
- Creating, Deleting, and Clearing Hash Objects During Execution of a DATA Step
- Determining the Number of Items in a Hash Object
- Application Example: Creating a Data Set for Each BY Group
- Comparing Two Hash Objects
- Specifying Memory Structure Usage of a Hash Object
- Determining the Size of an Entry in a Hash Object
- References
- Index
Product information
- Title: SAS Hash Object Programming Made Easy
- Author(s):
- Release date: September 2012
- Publisher(s): SAS Institute
- ISBN: 9781612900988
You might also like
book
PROC SQL: Beyond the Basics Using SAS®
Master the language of PROC SQL! Get faster and better results when you use the SQL …
book
Step-by-Step Programming with Base SAS 9.4
Provides conceptual information about the SAS programming language, as well as step-by-step examples that illustrate the …
book
Simulating Data with SAS
Data simulation is a fundamental technique in statistical programming and research. Rick Wicklin's Simulating Data with …
book
Getting Started with SAS Programming
Get up and running with SAS using Ron Cody’s easy-to-follow, step-by-step guide. Aimed at beginners, Getting …