Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition

Book description

Provides conceptual information about the SAS programming language, as well as step-by-step examples that illustrate the concepts.

Table of contents

  1. Contents (1/2)
  2. Contents (2/2)
  3. About This Book
    1. Syntax Conventions for the SAS Language
      1. Overview of Syntax Conventions for the SAS Language
      2. Syntax Components
      3. Style Conventions
      4. Special Characters
      5. References to SAS Libraries and External Files
  4. What’s New in Step-by-Step Programming with Base SAS 9.4
    1. Overview
    2. Debugging SAS Programs
    3. Concatenating SAS Variables
    4. Output Delivery System (ODS)
  5. Accessibility Features of Step-by-Step Programming with Base SAS 9.4
    1. Overview
  6. Introduction to the SAS System
    1. What is the SAS System?
      1. Introduction to the SAS System
      2. Components of Base SAS Software
        1. Overview of Base SAS Software
        2. Data Management Facility
        3. Programming Language
        4. Data Analysis and Reporting Utilities
      3. Output Produced by the SAS System
        1. Traditional Output
        2. Output from the Output Delivery System (ODS)
      4. Ways to Run SAS Programs
        1. Selecting an Approach
        2. SAS Windowing Environment
        3. SAS/ASSIST Software
        4. Noninteractive Mode
        5. Batch Mode
        6. Interactive Line Mode
      5. Running Programs in the SAS Windowing Environment
      6. Summary
        1. Statements
        2. Procedures
      7. Learning More
    2. Working with Output Defaults
      1. Working with Output Defaults Starting in SAS 9.3
        1. Overview of Working with Output Defaults
        2. The Default Destination
        3. HTML Output in the SAS Windowing Environment
        4. LISTING Output in the SAS Windowing Environment
        5. ODS Graphics
        6. How to Restore 9.2 Behavior
      2. Learning More
  7. Getting Your Data into Shape
    1. Introduction to DATA Step Processing
      1. Introduction to DATA Step Processing
        1. Purpose
        2. Prerequisites
      2. The SAS Data Set: Your Key to the SAS System
        1. Understanding the Function of the SAS Data Set
        2. Understanding the Structure of the SAS Data Set
        3. Using FILENAME and LIBNAME Statements
        4. Temporary versus Permanent SAS Data Sets
      3. How the DATA Step Works: A Basic Introduction (1/2)
      4. How the DATA Step Works: A Basic Introduction (2/2)
        1. Overview of the DATA Step
        2. During the Compilation Phase
        3. During the Execution Phase
        4. Example of a DATA Step
      5. Supplying Information to Create a SAS Data Set (1/2)
      6. Supplying Information to Create a SAS Data Set (2/2)
        1. Overview of Creating a SAS Data Set
        2. Telling SAS How to Read the Data: Styles of Input
        3. Reading Dates with Two-Digit and Four-Digit Year Values
        4. Defining Variables in SAS
        5. Indicating the Location of Your Data
        6. Using External Files in Your SAS Job
        7. Identifying an External File Directly
        8. Referencing an External File with a Fileref
      7. Summary
        1. Statements
      8. Learning More
    2. Starting with Raw Data: The Basics
      1. Introduction to Raw Data
        1. Purpose
        2. Prerequisites
      2. Examine the Structure of the Raw Data: Factors to Consider
      3. Reading Unaligned Data
        1. Understanding List Input
        2. Program: Basic List Input
        3. Program: When the Data Is Delimited by Characters, Not Blanks
        4. Program: When Consecutive Delimiters Indicate Missing Values
        5. List Input: Points to Remember
      4. Reading Data That Is Aligned in Columns
        1. Understanding Column Input
        2. Program: Reading Data Aligned in Columns
        3. Understanding Some Advantages of Column Input over Simple List Input
        4. Reading Embedded Blanks and Creating Longer Variables
        5. Program: Skipping Fields When Reading Data Records
        6. Column Input: Points to Remember
      5. Reading Data That Requires Special Instructions
        1. Understanding Formatted Input
        2. Program: Reading Data That Requires Special Instructions
        3. Understanding How to Control the Position of the Pointer
        4. Formatted Input: Points to Remember
      6. Reading Unaligned Data with More Flexibility
        1. Understanding How to Make List Input More Flexible
        2. Creating Longer Variables and Reading Numeric Data That Contains Special Characters
        3. Reading Character Data That Contains Embedded Blanks
      7. Mixing Styles of Input
        1. An Example of Mixed Input
        2. Understanding the Effect of Input Style on Pointer Location
      8. Summary
        1. Statements
        2. Column-Pointer Controls
      9. Learning More
    3. Starting with Raw Data: Beyond the Basics
      1. Introduction to Beyond the Basics with Raw Data
        1. Purpose
        2. Prerequisites
      2. Testing a Condition Before Creating an Observation
      3. Creating Multiple Observations from a Single Record
        1. Using the Double Trailing @ Line-Hold Specifier
        2. Understanding How the Double Trailing @ Affects DATA Step Execution
      4. Reading Multiple Records to Create a Single Observation (1/2)
      5. Reading Multiple Records to Create a Single Observation (2/2)
        1. How the Data Records Are Structured
        2. Method 1: Using Multiple Input Statements
        3. Method 2: Using the / Line-Pointer Control
        4. Reading Variables from Multiple Records in Any Order
        5. Understanding How the #n Line-Pointer Control Affects DATA Step Execution
      6. Problem Solving: When an Input Record Unexpectedly Does Not Have Enough Values
        1. Understanding the Default Behavior
        2. Methods of Control: Your Options
      7. Summary
        1. Column-Pointer Controls
        2. Line-Hold Specifiers
        3. Statements
      8. Learning More
    4. Starting with SAS Data Sets
      1. Introduction to Starting with SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Understanding the Basics
      3. Input SAS Data Set for Examples
      4. Reading Selected Observations
      5. Reading Selected Variables
        1. Overview of Reading Selected Variables
        2. Keeping Selected Variables
        3. Dropping Selected Variables
        4. Choosing between Data Set Options and Statements
        5. Choosing between the DROP= and KEEP= Data Set Option
      6. Creating More Than One Data Set in a Single DATA Step
      7. Using the DROP= and KEEP= Data Set Options for Efficiency
      8. Summary
        1. Data Set Options
        2. Procedures
        3. Statements
      9. Learning More
  8. Basic Programming
    1. Understanding DATA Step Processing
      1. Overview of DATA Step Processing
        1. Purpose
        2. Prerequisites
      2. Input SAS Data Set for Examples
      3. Adding Information to a SAS Data Set
        1. Understanding the Assignment Statement
        2. Making Uniform Changes to Data By Creating a Variable
        3. Adding Information to Some Observations but Not Others
        4. Making Uniform Changes to Data without Creating Variables
        5. Using Variables Efficiently
      4. Defining Enough Storage Space for Variables
      5. Conditionally Deleting an Observation
      6. Summary
        1. Statements
      7. Learning More
    2. Working with Numeric Variables
      1. Introduction to Working with Numeric Variables
        1. Purpose
        2. Prerequisites
      2. About Numeric Variables in SAS
      3. Input SAS Data Set for Examples
      4. Calculating with Numeric Variables
        1. Using Arithmetic Operators in Assignment Statements
        2. Understanding Numeric Expressions and Assignment Statements
        3. Understanding How SAS Handles Missing Values
        4. Calculating Numbers Using SAS Functions
      5. Comparing Numeric Variables
      6. Storing Numeric Variables Efficiently
      7. Summary
        1. Functions
        2. Statements
      8. Learning More
    3. Working with Character Variables
      1. Introduction to Working with Character Variables
        1. Purpose
        2. Prerequisites
        3. Character Variables in SAS
      2. Input SAS Data Set for Examples
      3. Identifying Character Variables and Expressing Character Values
      4. Setting the Length of Character Variables
      5. Handling Missing Values
        1. Reading Missing Values
        2. Checking for Missing Character Values
        3. Setting a Character Variable Value to Missing
      6. Creating New Character Values
        1. Extracting a Portion of a Character Value
        2. Combining Character Values: Using Concatenation
      7. Saving Storage Space by Treating Numbers as Characters
      8. Summary
        1. Functions
        2. Statements
      9. Learning More
    4. Acting on Selected Observations
      1. Introduction to Acting on Selected Observations
        1. Purpose
        2. Prerequisites
      2. Input SAS Data Set for Examples
      3. Selecting Observations
        1. Understanding the Selection Process
        2. Selecting Observations Based on a Simple Condition
        3. Providing an Alternative Action
        4. Creating a Series of Mutually Exclusive Conditions
      4. Constructing Conditions (1/2)
      5. Constructing Conditions (2/2)
        1. Understanding Construct Conditions
        2. Selecting an Observation Based on Simple Conditions
        3. Using More Than One Comparison in a Condition
      6. Comparing Characters
        1. Types of Character Comparisons
        2. Comparing Uppercase and Lowercase Characters
        3. Selecting All Values That Begin with the Same Group of Characters
        4. Selecting a Range of Character Values
        5. Finding a Value Anywhere within Another Character Value
      7. Summary
        1. Statements
        2. Functions
      8. Learning More
    5. Creating Subsets of Observations
      1. Introduction to Creating Subsets of Observations
        1. Purpose
        2. Prerequisites
      2. Input SAS Data Set for Examples
      3. Selecting Observations for a New SAS Data Set
        1. Deleting Observations Based on a Condition
        2. Accepting Observations Based on a Condition
        3. Comparing the DELETE and Subsetting IF Statements
      4. Conditionally Writing Observations to One or More SAS Data Sets
        1. Understanding the OUTPUT Statement
        2. Example for Conditionally Writing Observations to Multiple Data Sets
        3. Avoiding a Common Mistake When Writing to Multiple Data Sets
        4. Understanding Why the Placement of the OUTPUT Statement Is Important
        5. Writing an Observation Multiple Times to One or More Data Sets
      5. Summary
        1. Statements
      6. Learning More
    6. Working with Grouped or Sorted Observations
      1. Introduction to Working with Grouped or Sorted Observations
        1. Purpose
        2. Prerequisites
      2. Input SAS Data Set for Examples
      3. Working with Grouped Data (1/2)
      4. Working with Grouped Data (2/2)
        1. Understanding the Basics of Grouping Data
        2. Grouping Observations with the SORT Procedure
        3. Grouping by More Than One Variable
        4. Arranging Groups in Descending Order
        5. Finding the First or Last Observation in a Group
      5. Working with Sorted Data
        1. Understanding Sorted Data
        2. Sorting Data
        3. Deleting Duplicate Observations
        4. Understanding Collating Sequences
        5. ASCII Collating Sequence
        6. EBCDIC Collating Sequence
      6. Summary
        1. Procedures
        2. Statements
      7. Learning More
    7. Using More Than One Observation in a Calculation
      1. Introduction to Using More Than One Observation in a Calculation
        1. Purpose
        2. Prerequisites
      2. Input File and SAS Data Set for Examples
      3. Accumulating a Total for an Entire Data Set
        1. Creating a Running Total
        2. Writing Only the Total
      4. Obtaining a Total for Each BY Group
      5. Writing to Separate Data Sets
        1. Writing Observations to Separate Data Sets
        2. Writing Totals to Separate Data Sets
        3. The Program
      6. Using a Value in a Later Observation
      7. Summary
        1. Statements
      8. Learning More
    8. Finding Shortcuts in Programming
      1. Introduction to Shortcuts
        1. Purpose
        2. Prerequisites
      2. Input File and SAS Data Set
      3. Performing More Than One Action in an IF-THEN Statement
      4. Performing the Same Action for a Series of Variables
        1. Using a Series of IF-THEN Statements
        2. Grouping Variables into Arrays
        3. Repeating the Action
        4. Selecting the Current Variable
      5. Summary
        1. Statements
      6. Learning More
    9. Working with Dates in the SAS System
      1. Introduction to Working with Dates
        1. Purpose
        2. Prerequisites
      2. Understanding How SAS Handles Dates
        1. How SAS Stores Date Values
        2. Determining the Century for Dates with Two-Digit Years
      3. Input File and SAS Data Set for Examples
      4. Entering Dates
        1. Understanding Informats for Date Values
        2. Reading a Date Value
        3. Using Good Programming Practices to Read Dates
        4. Using Dates as Constants
      5. Displaying Dates
        1. Understanding How SAS Displays Values
        2. Formatting a Date Value
        3. Assigning Permanent Date Formats to Variables
        4. Changing Formats Temporarily
      6. Using Dates in Calculations
        1. Sorting Dates
        2. Creating New Date Variables
      7. Using SAS Date Functions
        1. Finding the Day of the Week
      8. Comparing Durations and SAS Date Values
      9. Summary
        1. Statements
        2. Formats and Informats for Dates
        3. Functions
        4. System Options
      10. Learning More
  9. Combining SAS Data Sets
    1. Methods of Combining SAS Data Sets
      1. Introduction to Combining SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Definition of Concatenating
      3. Definition of Interleaving
      4. Definition of Merging
      5. Definition of Updating
      6. Definition of Modifying
      7. Comparing Modifying, Merging, and Updating Data Sets
      8. Learning More
    2. Concatenating SAS Data Sets
      1. Introduction to Concatenating SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Concatenating Data Sets with the SET Statement (1/4)
      3. Concatenating Data Sets with the SET Statement (2/4)
      4. Concatenating Data Sets with the SET Statement (3/4)
      5. Concatenating Data Sets with the SET Statement (4/4)
        1. Understanding the SET Statement
        2. Using the SET Statement: The Simplest Case
        3. Using the SET Statement When Data Sets Contain Different Variables
        4. Using the SET Statement When Variables Have Different Attributes
      6. Concatenating Data Sets By Using the APPEND Procedure
        1. Understanding the APPEND Procedure
        2. Using the APPEND Procedure: The Simplest Case
        3. Using the APPEND Procedure When Data Sets Contain Different Variables
        4. Using the APPEND Procedure When Variables Have Different Attributes
      7. Choosing between the SET Statement and the APPEND Procedure
      8. Summary
        1. Statements
        2. Procedures
      9. Learning More
    3. Interleaving SAS Data Sets
      1. Introduction to Interleaving SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Understanding BY-Group Processing Concepts
      3. Interleaving Data Sets
        1. Preparing to Interleave Data Sets
        2. Understanding the Interleaving Process
        3. Using the Interleaving Process
      4. Summary
        1. Statements
      5. Learning More
    4. Merging SAS Data Sets
      1. Introduction to Merging SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Understanding the MERGE Statement
      3. One-to-One Merging
        1. Definition of One-to-One Merging
        2. Performing a Simple One-to-One Merge
        3. Performing a One-to-One Merge on Data Sets with the Same Variables
      4. Match-Merging (1/3)
      5. Match-Merging (2/3)
      6. Match-Merging (3/3)
        1. Merging with a BY Statement
        2. Input SAS Data Set for Examples
        3. The Program
        4. Explanation
        5. Match-Merging Data Sets with Multiple Observations in a BY Group
        6. Match-Merging Data Sets with Dropped Variables
        7. Match-Merging Data Sets with the IN= Data Set Option
        8. Match-Merging Data Sets with the Same Variables
        9. Match-Merging Data Sets That Lack a Common Variable
      7. Choosing between One-to-One Merging and Match-Merging
        1. Comparing Match-Merge Methods
        2. Input SAS Data Set for Examples
        3. When to Use a One-to-One Merge
        4. When to Use a Match-Merge
      8. Summary
        1. Statements
      9. Learning More
    5. Updating SAS Data Sets
      1. Introduction to Updating SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Understanding the UPDATE Statement
      3. Understanding How to Select BY Variables
      4. Updating a Data Set
      5. Updating with Incremental Values
      6. Understanding the Differences between Updating and Merging
        1. General Comparisons between Updating and Merging
        2. How the UPDATE and MERGE Statements Process Missing Values Differently
        3. How the UPDATE and MERGE Statements Process Multiple Observations in a BY Group Differently
      7. Handling Missing Values
      8. Summary
        1. Statements
      9. Learning More
    6. Modifying SAS Data Sets
      1. Introduction to Modifying SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Input SAS Data Set for Examples
      3. Modifying a SAS Data Set: The Simplest Case
      4. Modifying a Master Data Set with Observations from a Transaction Data Set
        1. Understanding the MODIFY Statement
        2. Adding New Observations to the Master Data Set
        3. Checking for Program Errors
        4. The Program
      5. Understanding How Duplicate BY Variables Affect File Update
        1. How the DATA Step Processes Duplicate BY Variables
        2. The Program
      6. Handling Missing Values
      7. Summary
        1. Statements
      8. Learning More
    7. Conditionally Processing Observations from Multiple SAS Data Sets
      1. Introduction to Conditional Processing from Multiple SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Input SAS Data Sets for Examples
      3. Determining Which Data Set Contributed the Observation
        1. Understanding the IN= Data Set Option
        2. The Program
      4. Combining Selected Observations from Multiple Data Sets
      5. Performing a Calculation Based on the Last Observation
        1. Understanding When the Last Observation Is Processed
        2. The Program
      6. Summary
        1. Statements
      7. Learning More
  10. Debugging SAS Programs
    1. Analyzing Your SAS Session with the SAS Log
      1. Introduction to Analyzing Your SAS Session with the SAS Log
        1. Purpose
        2. Prerequisites
      2. Understanding the SAS Log
        1. Understanding the Role of the SAS Log
        2. Resolving Errors with the Log
      3. Locating the SAS Log
      4. Understanding the Log Structure
        1. The Components of a SAS Log
        2. Messages in the SAS Log
        3. Notes in the SAS Log
        4. Warning Messages in the SAS Log
        5. Error Messages in the SAS Log
        6. Detecting a Syntax Error
      5. Writing to the SAS Log (1/2)
      6. Writing to the SAS Log (2/2)
        1. Default Output to the SAS Log
        2. Writing Messages to the SAS Log: The PUT Statement
        3. Writing the Contents of an Input Record: The LIST Statement
        4. Writing Messages to the SAS Log: The %PUT Macro Statement
      7. Suppressing Information in the SAS Log
        1. Using SAS System Options to Suppress Log Output
        2. Suppressing SAS Statements
        3. Suppressing System Notes
        4. Limiting the Number of Error Messages
        5. Controlling the Level of Detail in the SAS Log
        6. Suppressing SAS Statements, Notes, and Error Messages
      8. Changing the Appearance of the Log
      9. Summary
        1. Statements
        2. System Options
      10. Learning More
    2. Directing SAS Output and the SAS Log
      1. Introduction to Directing SAS Output and the SAS Log
        1. Purpose
        2. Prerequisites
      2. Input File and SAS Data Set for Examples
      3. Routing the Output and the SAS Log with PROC PRINTTO
        1. Routing Output to an Alternate Location
        2. Routing the SAS Log to an Alternate Location
        3. Restoring the Default Destination
      4. Storing the Output and the SAS Log in the SAS Windowing Environment
        1. Understanding the Default Destination
        2. Storing the Contents of the Output and Log Windows
      5. Redefining the Default Destination in a Batch or Noninteractive Environment
        1. Determining the Default Destination
        2. Changing the Default Destination
        3. Understanding the Configuration File
      6. Summary
        1. PROC PRINTTO Statement Options
        2. SAS Windowing Environment Commands
        3. SAS System Options
      7. Learning More
    3. Diagnosing and Avoiding Errors
      1. Introduction to Diagnosing and Avoiding Errors
        1. Purpose
        2. Prerequisites
      2. Understanding How the SAS Supervisor Checks a Job
      3. Understanding How SAS Processes Errors
      4. Distinguishing Types of Errors
        1. SAS Programming Errors
        2. Syntax Errors
        3. Execution-time Errors
        4. Data Errors
        5. Semantic Errors
      5. Diagnosing Errors (1/2)
      6. Diagnosing Errors (2/2)
        1. Examples in This Section
        2. Diagnosing Syntax Errors
        3. Diagnosing Execution-time Errors
        4. Diagnosing Data Errors
        5. Diagnosing Semantic Errors
      7. Using a Quality Control Checklist
      8. Learning More
    4. Finding Logic Errors in Your Program
      1. Finding Logic Errors in Your Program
        1. Purpose
        2. Prerequisites
      2. Using the DATA Step Debugger
      3. Basic Usage
        1. How a Debugger Session Works
        2. Using the Windows
        3. Entering Commands
        4. Working with Expressions
        5. Assigning Commands to Function Keys
      4. Using the Macro Facility with the Debugger
        1. Using Macros as Debugging Tools
        2. Creating Customized Debugging Commands with Macros
        3. Debugging a DATA Step Generated by a Macro
      5. Examples (1/3)
      6. Examples (2/3)
      7. Examples (3/3)
        1. Example 1: Debugging a Simple DATA Step When Output Is Missing
        2. Example 2: Working with Formats
        3. Example 3: Debugging DO Loops
        4. Example 4: Examining Formatted Values of Variables
  11. Producing Reports
    1. Producing Detail Reports with the PRINT Procedure
      1. Introduction to Producing Reports with the PRINT Procedure
        1. Purpose
        2. Prerequisites
      2. Input File and SAS Data Sets for Examples
      3. Creating Simple Reports (1/2)
      4. Creating Simple Reports (2/2)
        1. Showing All the Variables
        2. Labeling the Observation Column
        3. Suppressing the Observation Column
        4. Emphasizing a Key Variable
        5. Reporting the Values of Selected Variables
        6. Selecting Observations
      5. Creating Enhanced Reports (1/3)
      6. Creating Enhanced Reports (2/3)
      7. Creating Enhanced Reports (3/3)
        1. Ways to Enhance a Report
        2. Specifying Formats for the Variables
        3. Summing Numeric Variables
        4. Grouping Observations by Variable Values
        5. Grouping Observations in Multiple Sections
      8. Creating Customized Reports (1/2)
      9. Creating Customized Reports (2/2)
        1. Ways to Customize a Report
        2. Understanding Titles and Footnotes
        3. Adding Titles and Footnotes
        4. Defining Labels
        5. Splitting Labels across Two or More Lines
        6. Adding Blanks Lines
        7. Changing the Report Style
      10. Making Your Reports Easy to Change
        1. Understanding the SAS Macro Facility
        2. Using Automatic Macro Variables
        3. Using Your Own Macro Variables
        4. Defining Macro Variables
        5. Referring to Macro Variables
      11. Summary
        1. PROC PRINT Statements
        2. PROC SORT Statements
        3. SAS Macro Language
      12. Learning More
    2. Creating Summary Tables with the TABULATE Procedure
      1. Introduction to Creating Summary Tables with the TABULATE Procedure
        1. Purpose
        2. Prerequisites
      2. Understanding Summary Table Design
      3. Understanding the Basics of the TABULATE Procedure
        1. Required Statements for the TABULATE Procedure
        2. Begin with the PROC TABULATE Statement
        3. Specify Class Variables with the CLASS Statement
        4. Specify Analysis Variables with the VAR Statement
        5. Define the Table Structure with the TABLE Statement
        6. Identifying Missing Values for Class Variables
      4. Input File and SAS Data Set for Examples
      5. Creating Simple Summary Tables
        1. Creating a Basic One-Dimensional Summary Table
        2. Creating a Basic Two-Dimensional Summary Table
        3. Creating a Basic Three-Dimensional Summary Table
        4. Producing Multiple Tables in a Single PROC TABULATE Step
      6. Creating More Sophisticated Summary Tables (1/3)
      7. Creating More Sophisticated Summary Tables (2/3)
      8. Creating More Sophisticated Summary Tables (3/3)
        1. Creating Hierarchical Tables to Report on Subgroups
        2. Formatting Output
        3. Calculating Descriptive Statistics
        4. Reporting on Multiple Statistics
        5. Reducing Code and Applying a Single Label to Multiple Elements
        6. Getting Summaries for All Variables
        7. Defining Labels
        8. Using Styles and the Output Delivery System
        9. Ordering Class Variables
      9. Summary
        1. Global Statement
        2. TABULATE Procedure Statements
      10. Learning More
    3. Creating Detail and Summary Reports with the REPORT Procedure
      1. Introduction to Creating Detail and Summary Reports with the REPORT Procedure
        1. Purpose
        2. Prerequisites
      2. Understanding How to Construct a Report
        1. Using the Report Writing Tools
        2. Types of Reports
        3. Laying Out a Report
      3. Input File and SAS Data Set for Examples
      4. Creating Simple Reports (1/2)
      5. Creating Simple Reports (2/2)
        1. Displaying All the Variables
        2. Specifying and Ordering the Columns
        3. Ordering the Rows
        4. Consolidating Several Observations into a Single Row
        5. Changing the Default Order of the Rows
      6. Creating More Sophisticated Reports (1/2)
      7. Creating More Sophisticated Reports (2/2)
        1. Adjusting the Column Layout
        2. Customizing Column Headings
        3. Specifying Formats
        4. Using Variable Values as Column Headings
        5. Summarizing Groups of Observations
      8. Summary
        1. PROC REPORT Statements
      9. Learning More
  12. Producing Plots and Charts
    1. Plotting the Relationship between Variables
      1. Introduction to Plotting the Relationship between Variables
        1. Overview
        2. Prerequisites
      2. Input File and SAS Data Set for Examples
      3. Plotting One Set of Variables
        1. Understanding the PLOT Statement
        2. Example
      4. Enhancing the Plot
        1. Specifying the Axes Labels
        2. Specifying the Tick Marks Values
        3. Specifying Plotting Symbols
        4. Removing the Legend
      5. Plotting Multiple Sets of Variables (1/2)
      6. Plotting Multiple Sets of Variables (2/2)
        1. Creating Multiple Plots on Separate Pages
        2. Creating Multiple Plots on the Same Page
        3. Plotting Multiple Sets of Variables on the Same Axes
      7. Summary
        1. PROC PLOT Statements
      8. Learning More
    2. Producing Charts to Summarize Variables
      1. Introduction to Producing Charts to Summarize Variables
        1. Purpose
        2. Prerequisites
      2. Understanding the Charting Tools
      3. Input File and SAS Data Set for Examples
      4. Charting Frequencies with the CHART Procedure (1/2)
      5. Charting Frequencies with the CHART Procedure (2/2)
        1. Types of Frequency Charts
        2. Creating Vertical Bar Charts
        3. Creating a Horizontal Bar Chart
        4. Creating Block Charts
        5. Creating Pie Charts
      6. Customizing Frequency Charts (1/3)
      7. Customizing Frequency Charts (2/3)
      8. Customizing Frequency Charts (3/3)
        1. Changing the Number of Ranges
        2. Specifying Midpoints for a Numeric Variable
        3. Specifying the Number of Midpoints in a Chart
        4. Charting Every Value
        5. Charting the Frequency of a Character Variable
        6. Charting Mean Values
        7. Creating a Three-Dimensional Chart
      9. Creating High-Resolution Histograms (1/3)
      10. Creating High-Resolution Histograms (2/3)
      11. Creating High-Resolution Histograms (3/3)
        1. Understanding How to Use the HISTOGRAM Statement
        2. Understanding How to Use SAS/GRAPH to Create Histograms
        3. Creating a Simple Histogram
        4. Changing the Axes of a Histogram
        5. Displaying Summary Statistics in a Histogram
        6. Creating a Comparative Histogram
      12. Summary
        1. PROC CHART Statements
        2. PROC UNIVARIATE Statements
        3. GOPTIONS Statement
        4. FORMAT Statement
      13. Learning More
  13. Designing Your Own Output
    1. Writing Lines to the SAS Log or to an Output File
      1. Introduction to Writing Lines to the SAS Log or to an Output File
        1. Purpose
        2. Prerequisites
      2. Understanding the PUT Statement
      3. Writing Output without Creating a Data Set
      4. Writing Simple Text (1/2)
      5. Writing Simple Text (2/2)
        1. Writing a Character String
        2. Writing Variable Values
        3. Writing on the Same Line More Than Once
        4. Releasing a Held Line
      6. Writing a Report (1/2)
      7. Writing a Report (2/2)
        1. Writing to an Output File
        2. Designing the Report
        3. Writing Data Values
        4. Improving the Appearance of Numeric Data Values
        5. Writing a Value at the Beginning of Each BY Group
        6. Calculating Totals
        7. Writing Headings and Footnotes for a One-Page Report
      8. Summary
        1. Statements
      9. Learning More
    2. Understanding and Customizing SAS Output: The Basics
      1. Introduction to the Basics of Understanding and Customizing SAS Output
        1. Purpose
        2. Prerequisites
      2. Understanding Output
        1. Output from Procedures
        2. Output from DATA Step Applications
        3. Output from the Output Delivery System (ODS)
      3. Input SAS Data Set for Examples
      4. Locating Procedure Output
      5. Making Output Informative (1/2)
      6. Making Output Informative (2/2)
        1. Adding Titles
        2. Adding Footnotes
        3. Labeling Variables
        4. Developing Descriptive Output
      7. Controlling Output Appearance of Listing Output
        1. Specifying SAS System Options
        2. Numbering Pages
        3. Centering Output
        4. Specifying Page and Line Size
        5. Writing Date and Time Values
        6. Choosing Options Selectively
      8. Controlling the Appearance of Pages (1/3)
      9. Controlling the Appearance of Pages (2/3)
      10. Controlling the Appearance of Pages (3/3)
        1. Input Data Set for Examples of Multiple-page Reports
        2. Writing Centered Title and Column Headings
        3. Writing Titles and Column Headings in Specific Columns
        4. Changing a Portion of a Heading
        5. Controlling Page Divisions
      11. Representing Missing Values
        1. Recognizing Default Values
        2. Customizing Output of Missing Values By Using a System Option
        3. Customizing Output of Missing Values By Using a Procedure
      12. Summary
        1. Statements
        2. SAS System Options
      13. Learning More
    3. Understanding and Customizing SAS Output: The Output Delivery System (ODS)
      1. Introduction to Customizing SAS Output By Using the Output Delivery System
        1. Purpose
        2. Prerequisites
      2. Input Data Set for Examples
      3. Understanding ODS Output Formats and Destinations
      4. Selecting an Output Format
      5. Creating Formatted Output (1/3)
      6. Creating Formatted Output (2/3)
      7. Creating Formatted Output (3/3)
        1. Creating HTML Output for a Web Browser
        2. Creating PDF Output for Adobe Acrobat and Other Applications
        3. Creating RTF and PowerPoint Output
      8. Selecting the Output That You Want to Format (1/2)
      9. Selecting the Output That You Want to Format (2/2)
        1. Identifying Output
        2. Selecting and Excluding Program Output
        3. Creating a SAS Data Set
      10. Customizing ODS Output (1/3)
      11. Customizing ODS Output (2/3)
      12. Customizing ODS Output (3/3)
        1. Customizing ODS Output at the Level of a SAS Job
        2. Customizing ODS Output By Using a Template
      13. Storing Links to ODS Output
      14. Summary
        1. ODS Statements
        2. PROC SORT Statements
        3. PROC TABULATE Statements
        4. PROC TEMPLATE Statements
        5. PROC UNIVARIATE Statements
      15. Learning More
  14. Storing and Managing Data in SAS Files
    1. Understanding SAS Libraries
      1. Introduction to Understanding SAS Libraries
        1. Purpose
        2. Prerequisites
      2. What Is a SAS Library?
      3. Accessing a SAS Library
        1. Telling SAS Where the SAS Library Is Located
        2. Assigning a Libref
        3. Using Librefs for Temporary and Permanent Libraries
      4. Storing Files in a SAS Library
        1. What Is a SAS File?
        2. Understanding SAS Data Sets
        3. Understanding Other SAS Files
      5. Referencing SAS Data Sets in a SAS Library
        1. Understanding Data Set Names
        2. Using a One-Level Name
        3. Using a Two-Level Name
      6. Summary
        1. Statements
        2. SAS Data Set Reference
      7. Learning More
    2. Managing SAS Libraries
      1. Introduction to Managing SAS Libraries
        1. Purpose
        2. Prerequisites
      2. Choosing Your Tools
      3. Understanding the DATASETS Procedure
      4. Looking at a PROC DATASETS Session
      5. Summary
        1. Procedures
        2. Statements
      6. Learning More
    3. Getting Information about Your SAS Data Sets
      1. Introduction to Getting Information about Your SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Input Data Library for Examples
      3. Requesting a Directory Listing for a SAS Library
        1. Understanding a Directory Listing
        2. Listing All Files in a Library
        3. Listing Files That Have the Same Member Type
      4. Requesting Contents Information about SAS Data Sets
        1. Using the DATASETS Procedure for SAS Data Sets
        2. Listing the Contents of One Data Set
        3. Listing the Contents of All Data Sets in a Library
      5. Requesting Contents Information in Different Formats
      6. Summary
        1. Procedures
        2. DATASETS Procedure Statements
      7. Learning More
    4. Modifying SAS Data Set Names and Variable Attributes
      1. Introduction to Modifying SAS Data Set Names and Variable Attributes
        1. Purpose
        2. Prerequisites
      2. Input Data Library for Examples
      3. Renaming SAS Data Sets
      4. Modifying Variable Attributes (1/2)
      5. Modifying Variable Attributes (2/2)
        1. Understanding How to Modify Variable Attributes
        2. Renaming Variables
        3. Assigning, Changing, or Removing Formats
        4. Assigning, Changing, or Removing Labels
      6. Summary
        1. DATASETS Procedure Statements
      7. Learning More
    5. Copying, Moving, and Deleting SAS Data Sets
      1. Introduction to Copying, Moving, and Deleting SAS Data Sets
        1. Purpose
        2. Prerequisites
      2. Input Data Libraries for Examples
      3. Copying SAS Data Sets
        1. Copying from the Procedure Input Library
        2. Copying from Other Libraries
      4. Copying Specific SAS Data Sets
        1. Selecting Data Sets to Copy
        2. Excluding Data Sets from Copying
      5. Moving SAS Libraries and SAS Data Sets
        1. Moving Libraries
        2. Moving Specific Data Sets
      6. Deleting SAS Data Sets
        1. Specifying Data Sets to Delete
        2. Specifying Data Sets to Save
      7. Deleting All Files in a SAS Library
      8. Summary
        1. Procedures
        2. DATASETS Procedure Statements
      9. Learning More
  15. Understanding Your SAS Environment
    1. Introducing the SAS Environment
      1. Introduction to the SAS Environment
        1. Purpose
        2. Prerequisites
        3. Operating Environment Differences
      2. Starting a SAS Session
      3. Selecting a SAS Processing Mode (1/2)
      4. Selecting a SAS Processing Mode (2/2)
        1. Processing Modes and Categories
        2. Processing in the SAS Windowing Environment
        3. Processing Interactively in Line Mode
        4. Processing in Batch Mode
        5. Processing Noninteractively
      5. Summary
        1. Command
        2. Options
        3. System Options
        4. Statements
        5. Commands
      6. Learning More
        1. Operating Environment Information
        2. Windowing Environment Commands
        3. Documentation
    2. Using the SAS Windowing Environment
      1. Introduction to Using the SAS Windowing Environment
        1. Purpose
        2. Prerequisites
        3. Operating Environment Differences
      2. Getting Organized
        1. Overview of Data Organization
        2. Exploring Libraries and Library Members
        3. Assigning a Library Reference
        4. Managing Library Assignment Problems
      3. Finding Online Help
        1. Accessing SAS Online Help System
        2. Accessing Window Help
      4. Using SAS Windowing Environment Command Types
        1. Overview of SAS Windowing Environment Command Types
        2. Using Command-Line Commands
        3. Using Menus
        4. Using Line Commands
        5. Using Function Keys
      5. Working with SAS Windows
        1. Opening Windows
        2. Managing Windows
        3. Scrolling Windows
        4. Example: Scrolling Windows
        5. Changing Colors and Highlighting in Windows
        6. Finding and Changing Text
        7. Cutting, Pasting, and Storing Text
      6. Working with Text
        1. The SAS Text Editor
        2. Moving and Rearranging Text
        3. Displaying Columns and Line Numbers
        4. Making Text Uppercase and Lowercase
        5. Combining and Separating Text
      7. Working with Files
        1. Ways to Find a File
        2. Issuing File-Specific Commands
        3. Opening Files
        4. Assigning a File Shortcut
        5. Modifying an Existing File Shortcut
        6. Printing Files
      8. Working with SAS Programs (1/2)
      9. Working with SAS Programs (2/2)
        1. Editor Window
        2. Output Window
        3. Log Window
        4. Using Other Editors
        5. Creating and Submitting a Program
        6. Storing a Program
        7. Debugging a Program
        8. Opening a Program
        9. Editing a Program
        10. Assigning a Program to a File Shortcut
      10. Working with Output (1/2)
      11. Working with Output (2/2)
        1. Overview of Working with Output
        2. Setting Output Format
        3. Assigning a Default Viewer to a SAS Output Type
        4. Working with Output in the Results Window
        5. Working with Output Templates
        6. Printing Output
      12. Summary
        1. Statements
        2. Windows
        3. Commands
        4. Procedures
      13. Learning More
    3. Customizing the SAS Environment
      1. Introduction to Customizing the SAS Environment
        1. Purpose
        2. Prerequisites
        3. Operating Environment Differences
      2. Customizing Your Current Session
        1. Ways to Customize
        2. Customizing SAS Sessions and Programs at Start-up
        3. Customizing with SAS System Options
      3. Customizing Session-to-Session Settings
        1. Overview of Customizing Session-to-Session Settings
        2. Customizing SAS Sessions and Applications with the SAS Registry Editor
        3. Customizing SAS Sessions with the Preferences Window
        4. Saving System Option Settings with the DMOPTSAVE and DMOPTLOAD Commands
      4. Customizing the SAS Windowing Environment
        1. Customizing the Explorer Window
        2. Customizing an Editor
        3. Customizing Fonts
        4. Customizing Colors
        5. Setting SAS Windowing Environment Preferences
      5. Summary
        1. Commands
        2. Procedures
        3. Statements
        4. System Options
        5. Windows
      6. Learning More
  16. Appendix
    1. Complete DATA Steps for Selected Examples
      1. Complete DATA Steps for Selected Examples
      2. The CITY Data Set
        1. DATA Step to Create the CITY Data Set
      3. The UNIVERSITY_TEST_SCORES Data Set
        1. DATA Step to Create the UNIVERSITY_TEST_SCORES Data Set
      4. The YEAR_SALES Data Set
        1. DATA Step to Create the YEAR_SALES Data Set
      5. The HIGHLOW Data Set
        1. DATA Step to Create the HIGHLOW Data Set
      6. The GRADES Data Set
        1. DATA Step to Create the GRADES Data Set
      7. The USCLIM Data Sets
        1. DATA Step to Create the USCLIM.HIGHTEMP Data Set
        2. DATA Step to Create the USCLIM.HURRICANE Data Set
        3. DATA Step to Create the USCLIM.LOWTEMP Data Set
        4. DATA Step to Create the USCLIM.TEMPCHNG Data Set
        5. Note about the USCLIM.BASETEMP and USCLIM.REPORT Catalogs
      8. The CLIMATE, PRECIP, and STORM Data Sets
        1. DATA Step to Create the CLIMATE.HIGHTEMP Data Set
        2. DATA Step to Create the CLIMATE.LOWTEMP Data Set
        3. DATA Step to Create the PRECIP.RAIN Data Set
        4. DATA Step to Create the PRECIP.SNOW Data Set
        5. DATA Step to Create the STORM.TORNADO Data Set
    2. DATA Step Debugger Commands
      1. Dictionary
        1. BREAK
        2. CALCULATE
        3. DELETE
        4. DESCRIBE
        5. ENTER
        6. EXAMINE
        7. GO
        8. HELP
        9. JUMP
        10. LIST
        11. QUIT
        12. SET
        13. STEP
        14. SWAP
        15. TRACE
        16. WATCH
  17. Glossary (1/4)
  18. Glossary (2/4)
  19. Glossary (3/4)
  20. Glossary (4/4)
  21. Index (1/7)
  22. Index (2/7)
  23. Index (3/7)
  24. Index (4/7)
  25. Index (5/7)
  26. Index (6/7)
  27. Index (7/7)

Product information

  • Title: Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition
  • Author(s): SAS Institute
  • Release date: January 2017
  • Publisher(s): SAS Institute
  • ISBN: 9781629608068