Home Page Icon
Home Page
Table of Contents for
Chapter 5: Starting with Raw Data: Beyond the Basics
Close
Chapter 5: Starting with Raw Data: Beyond the Basics
by SAS Institute
Step-by-Step Programming with Base SAS 9.4
Title Page
Copyright
Additional Resources
What’s New in Step-by-Step Programming with Base SAS 9.4
Accessibility Features of Step-by-Step Programming with Base SAS 9.4
About This Book
Part 1: Introduction to the SAS System
Chapter 1: What is the SAS System?
Introduction to the SAS System
Components of Base SAS Software
Output Produced by the SAS System
Ways to Run SAS Programs
Running Programs in the SAS Windowing Environment
Summary
Learning More
End Notes
Chapter 2: Working with Output Defaults
Working with Output Defaults Starting in SAS 9.3
Learning More
Part 2: Getting Your Data into Shape
Chapter 3: Introduction to DATA Step Processing
Introduction to DATA Step Processing
The SAS Data Set: Your Key to the SAS System
How the DATA Step Works: A Basic Introduction
Supplying Information to Create a SAS Data Set
Summary
Learning More
Chapter 4: Starting with Raw Data: The Basics
Introduction to Raw Data
Examine the Structure of the Raw Data: Factors to Consider
Reading Unaligned Data
Reading Data That Is Aligned in Columns
Reading Data That Requires Special Instructions
Reading Unaligned Data with More Flexibility
Mixing Styles of Input
Summary
Learning More
Chapter 5: Starting with Raw Data: Beyond the Basics
Introduction to Beyond the Basics with Raw Data
Testing a Condition Before Creating an Observation
Creating Multiple Observations from a Single Record
Reading Multiple Records to Create a Single Observation
Problem Solving: When an Input Record Unexpectedly Does Not Have Enough Values
Summary
Learning More
Chapter 6: Starting with SAS Data Sets
Introduction to Starting with SAS Data Sets
Understanding the Basics
Input SAS Data Set for Examples
Reading Selected Observations
Reading Selected Variables
Creating More Than One Data Set in a Single DATA Step
Using the DROP= and KEEP= Data Set Options for Efficiency
Summary
Learning More
Part 3: Basic Programming
Chapter 7: Understanding DATA Step Processing
Overview of DATA Step Processing
Input SAS Data Set for Examples
Adding Information to a SAS Data Set
Defining Enough Storage Space for Variables
Conditionally Deleting an Observation
Summary
Learning More
Chapter 8: Working with Numeric Variables
Introduction to Working with Numeric Variables
About Numeric Variables in SAS
Input SAS Data Set for Examples
Calculating with Numeric Variables
Comparing Numeric Variables
Storing Numeric Variables Efficiently
Summary
Learning More
Chapter 9: Working with Character Variables
Introduction to Working with Character Variables
Input SAS Data Set for Examples
Identifying Character Variables and Expressing Character Values
Setting the Length of Character Variables
Handling Missing Values
Creating New Character Values
Saving Storage Space by Treating Numbers as Characters
Summary
Learning More
Chapter 10: Acting on Selected Observations
Introduction to Acting on Selected Observations
Input SAS Data Set for Examples
Selecting Observations
Constructing Conditions
Comparing Characters
Summary
Learning More
End Notes
Chapter 11: Creating Subsets of Observations
Introduction to Creating Subsets of Observations
Input SAS Data Set for Examples
Selecting Observations for a New SAS Data Set
Conditionally Writing Observations to One or More SAS Data Sets
Summary
Learning More
Chapter 12: Working with Grouped or Sorted Observations
Introduction to Working with Grouped or Sorted Observations
Input SAS Data Set for Examples
Working with Grouped Data
Working with Sorted Data
Summary
Learning More
Chapter 13: Using More Than One Observation in a Calculation
Introduction to Using More Than One Observation in a Calculation
Input File and SAS Data Set for Examples
Accumulating a Total for an Entire Data Set
Obtaining a Total for Each BY Group
Writing to Separate Data Sets
Using a Value in a Later Observation
Summary
Learning More
Chapter 14: Finding Shortcuts in Programming
Introduction to Shortcuts
Input File and SAS Data Set
Performing More Than One Action in an IF-THEN Statement
Performing the Same Action for a Series of Variables
Summary
Learning More
Chapter 15: Working with Dates in the SAS System
Introduction to Working with Dates
Understanding How SAS Handles Dates
Input File and SAS Data Set for Examples
Entering Dates
Displaying Dates
Using Dates in Calculations
Using SAS Date Functions
Comparing Durations and SAS Date Values
Summary
Learning More
Part 4: Combining SAS Data Sets
Chapter 16: Methods of Combining SAS Data Sets
Introduction to Combining SAS Data Sets
Definition of Concatenating
Definition of Interleaving
Definition of Merging
Definition of Updating
Definition of Modifying
Comparing Modifying, Merging, and Updating Data Sets
Learning More
Chapter 17: Concatenating SAS Data Sets
Introduction to Concatenating SAS Data Sets
Concatenating Data Sets with the SET Statement
Concatenating Data Sets By Using the APPEND Procedure
Choosing between the SET Statement and the APPEND Procedure
Summary
Learning More
Chapter 18: Interleaving SAS Data Sets
Introduction to Interleaving SAS Data Sets
Understanding BY-Group Processing Concepts
Interleaving Data Sets
Summary
Learning More
Chapter 19: Merging SAS Data Sets
Introduction to Merging SAS Data Sets
Understanding the MERGE Statement
One-to-One Merging
Match-Merging
Choosing between One-to-One Merging and Match-Merging
Summary
Learning More
Chapter 20: Updating SAS Data Sets
Introduction to Updating SAS Data Sets
Understanding the UPDATE Statement
Understanding How to Select BY Variables
Updating a Data Set
Updating with Incremental Values
Understanding the Differences between Updating and Merging
Handling Missing Values
Summary
Learning More
Chapter 21: Modifying SAS Data Sets
Introduction to Modifying SAS Data Sets
Input SAS Data Set for Examples
Modifying a SAS Data Set: The Simplest Case
Modifying a Master Data Set with Observations from a Transaction Data Set
Understanding How Duplicate BY Variables Affect File Update
Handling Missing Values
Summary
Learning More
Chapter 22: Conditionally Processing Observations from Multiple SAS Data Sets
Introduction to Conditional Processing from Multiple SAS Data Sets
Input SAS Data Sets for Examples
Determining Which Data Set Contributed the Observation
Combining Selected Observations from Multiple Data Sets
Performing a Calculation Based on the Last Observation
Summary
Learning More
Part 5: Debugging SAS Programs
Chapter 23: Analyzing Your SAS Session with the SAS Log
Introduction to Analyzing Your SAS Session with the SAS Log
Understanding the SAS Log
Locating the SAS Log
Understanding the Log Structure
Writing to the SAS Log
Suppressing Information in the SAS Log
Changing the Appearance of the Log
Summary
Learning More
Chapter 24: Directing SAS Output and the SAS Log
Introduction to Directing SAS Output and the SAS Log
Input File and SAS Data Set for Examples
Routing the Output and the SAS Log with PROC PRINTTO
Storing the Output and the SAS Log in the SAS Windowing Environment
Redefining the Default Destination in a Batch or Noninteractive Environment
Summary
Learning More
Chapter 25: Diagnosing and Avoiding Errors
Introduction to Diagnosing and Avoiding Errors
Understanding How the SAS Supervisor Checks a Job
Understanding How SAS Processes Errors
Distinguishing Types of Errors
Diagnosing Errors
Using a Quality Control Checklist
Learning More
Chapter 26: Finding Logic Errors in Your Program
Finding Logic Errors in Your Program
Using the DATA Step Debugger
Basic Usage
Using the Macro Facility with the Debugger
Examples
Part 6: Producing Reports
Chapter 27: Producing Detail Reports with the PRINT Procedure
Introduction to Producing Reports with the PRINT Procedure
Input File and SAS Data Sets for Examples
Creating Simple Reports
Creating Enhanced Reports
Creating Customized Reports
Making Your Reports Easy to Change
Summary
Learning More
End Notes
Chapter 28: Creating Summary Tables with the TABULATE Procedure
Introduction to Creating Summary Tables with the TABULATE Procedure
Understanding Summary Table Design
Understanding the Basics of the TABULATE Procedure
Input File and SAS Data Set for Examples
Creating Simple Summary Tables
Creating More Sophisticated Summary Tables
Summary
Learning More
Chapter 29: Creating Detail and Summary Reports with the REPORT Procedure
Introduction to Creating Detail and Summary Reports with the REPORT Procedure
Understanding How to Construct a Report
Input File and SAS Data Set for Examples
Creating Simple Reports
Creating More Sophisticated Reports
Summary
Learning More
End Notes
Part 7: Producing Plots and Charts
Chapter 30: Plotting the Relationship between Variables
Introduction to Plotting the Relationship between Variables
Input File and SAS Data Set for Examples
Plotting One Set of Variables
Enhancing the Plot
Plotting Multiple Sets of Variables
Summary
Learning More
Chapter 31: Producing Charts to Summarize Variables
Introduction to Producing Charts to Summarize Variables
Understanding the Charting Tools
Input File and SAS Data Set for Examples
Charting Frequencies with the CHART Procedure
Customizing Frequency Charts
Creating High-Resolution Histograms
Summary
Learning More
End Notes
Part 8: Designing Your Own Output
Chapter 32: Writing Lines to the SAS Log or to an Output File
Introduction to Writing Lines to the SAS Log or to an Output File
Understanding the PUT Statement
Writing Output without Creating a Data Set
Writing Simple Text
Writing a Report
Summary
Learning More
Chapter 33: Understanding and Customizing SAS Output: The Basics
Introduction to the Basics of Understanding and Customizing SAS Output
Understanding Output
Input SAS Data Set for Examples
Locating Procedure Output
Making Output Informative
Controlling Output Appearance of Listing Output
Controlling the Appearance of Pages
Representing Missing Values
Summary
Learning More
Chapter 34: Understanding and Customizing SAS Output: The Output Delivery System (ODS)
Introduction to Customizing SAS Output By Using the Output Delivery System
Input Data Set for Examples
Understanding ODS Output Formats and Destinations
Selecting an Output Format
Creating Formatted Output
Selecting the Output That You Want to Format
Customizing ODS Output
Storing Links to ODS Output
Summary
Learning More
Part 9: Storing and Managing Data in SAS Files
Chapter 35: Understanding SAS Libraries
Introduction to Understanding SAS Libraries
What Is a SAS Library?
Accessing a SAS Library
Storing Files in a SAS Library
Referencing SAS Data Sets in a SAS Library
Summary
Learning More
Chapter 36: Managing SAS Libraries
Introduction to Managing SAS Libraries
Choosing Your Tools
Understanding the DATASETS Procedure
Looking at a PROC DATASETS Session
Summary
Learning More
Chapter 37: Getting Information about Your SAS Data Sets
Introduction to Getting Information about Your SAS Data Sets
Input Data Library for Examples
Requesting a Directory Listing for a SAS Library
Requesting Contents Information about SAS Data Sets
Requesting Contents Information in Different Formats
Summary
Learning More
Chapter 38: Modifying SAS Data Set Names and Variable Attributes
Introduction to Modifying SAS Data Set Names and Variable Attributes
Input Data Library for Examples
Renaming SAS Data Sets
Modifying Variable Attributes
Summary
Learning More
Chapter 39: Copying, Moving, and Deleting SAS Data Sets
Introduction to Copying, Moving, and Deleting SAS Data Sets
Input Data Libraries for Examples
Copying SAS Data Sets
Copying Specific SAS Data Sets
Moving SAS Libraries and SAS Data Sets
Deleting SAS Data Sets
Deleting All Files in a SAS Library
Summary
Learning More
Part 10: Understanding Your SAS Environment
Chapter 40: Introducing the SAS Environment
Introduction to the SAS Environment
Starting a SAS Session
Selecting a SAS Processing Mode
Summary
Learning More
End Notes
Chapter 41: Using the SAS Windowing Environment
Introduction to Using the SAS Windowing Environment
Getting Organized
Finding Online Help
Using SAS Windowing Environment Command Types
Working with SAS Windows
Working with Text
Working with Files
Working with SAS Programs
Working with Output
Summary
Learning More
Chapter 42: Customizing the SAS Environment
Introduction to Customizing the SAS Environment
Customizing Your Current Session
Customizing Session-to-Session Settings
Customizing the SAS Windowing Environment
Summary
Learning More
Part 11: Appendix
Appendix 1: Complete DATA Steps for Selected Examples
Complete DATA Steps for Selected Examples
The CITY Data Set
The UNIVERSITY_TEST_SCORES Data Set
The YEAR_SALES Data Set
The HIGHLOW Data Set
The GRADES Data Set
The USCLIM Data Sets
The CLIMATE, PRECIP, and STORM Data Sets
Appendix 2: DATA Step Debugger Commands
BREAK
CALCULATE
DELETE
DESCRIBE
ENTER
EXAMINE
GO
HELP
JUMP
LIST
QUIT
SET
STEP
SWAP
TRACE
WATCH
Glossary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Learning More
Next
Next Chapter
Introduction to Beyond the Basics with Raw Data
Chapter 5: Starting with Raw Data: Beyond the Basics
Introduction to Beyond the Basics with Raw Data
Testing a Condition Before Creating an Observation
Creating Multiple Observations from a Single Record
Reading Multiple Records to Create a Single Observation
Problem Solving: When an Input Record Unexpectedly Does Not Have Enough Values
Summary
Learning More
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset