Hands-On SAS for Data Analysis

Book description

Leverage the full potential of SAS to get unique, actionable insights from your data

Key Features

  • Build enterprise-class data solutions using SAS and become well-versed in SAS programming
  • Work with different data structures, and run SQL queries to manipulate your data
  • Explore essential concepts and techniques with practical examples to confidently pass the SAS certification exam

Book Description

SAS is one of the leading enterprise tools in the world today when it comes to data management and analysis. It enables the fast and easy processing of data and helps you gain valuable business insights for effective decision-making. This book will serve as a comprehensive guide that will prepare you for the SAS certification exam.

After a quick overview of the SAS architecture and components, the book will take you through the different approaches to importing and reading data from different sources using SAS. You will then cover SAS Base and 4GL, understanding data management and analysis, along with exploring SAS functions for data manipulation and transformation. Next, you'll discover SQL procedures and get up to speed on creating and validating queries. In the concluding chapters, you'll learn all about data visualization, right from creating bar charts and sample geographic maps through to assigning patterns and formats. In addition to this, the book will focus on macro programming and its advanced aspects.

By the end of this book, you will be well versed in SAS programming and have the skills you need to easily handle and manage your data-related problems in SAS.

What you will learn

  • Explore a variety of SAS modules and packages for efficient data analysis
  • Use SAS 4GL functions to manipulate, merge, sort, and transform data
  • Gain useful insights into advanced PROC SQL options in SAS to interact with data
  • Get to grips with SAS Macro and define your own macros to share data
  • Discover the different graphical libraries to shape and visualize data with
  • Apply the SAS Output Delivery System to prepare detailed reports

Who this book is for

Budding or experienced data professionals who want to get started with SAS will benefit from this book. Those looking to prepare for the SAS certification exam will also find this book to be a useful resource. Some understanding of basic data management concepts will help you get the most out of this book.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On SAS For Data Analysis
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Section 1: SAS Basics
  7. Introduction to SAS Programming
    1. SAS dataset fundamentals
      1. Creating an SAS table
        1. Compile phase
        2. Execution phase
      2. Dataset creation example
    2. SAS programming language – basic syntax
      1. Data step
      2. Proc SQL
    3. SAS LOG
      1. Naming conventions in SAS
        1. Naming conventions for Teradata in SAS
    4. Dataset options
      1. Compression
      2. Encryption
      3. Indexing
    5. SAS operators
      1. Arithmetic operators
      2. Comparison operators
      3. Logical operators
    6. Formats
      1. Formatting to make the data readable
      2. Specifying a format to make it meaningful
      3. Altering the data type
    7. Subsetting datasets
      1. WHERE and IF statements
      2. Using OPTIONS
      3. DROP or KEEP options
      4. Viewing properties
    8. Dictionary tables
      1. Role of _ALL_ and _IN_
    9. Summary
  8. Data Manipulation and Transformation
    1. Length of a variable
    2. Case conversion and alignment
      1. LowCase, PropCase, and UpCase
      2. AnyUpper, AnyLower, and NoTupper
      3. Left and right
    3. String identification
      1. The Scan function
      2. Index, Indexc, and Indexw
      3. Find
    4. Dealing with blanks
      1. Compress, Strip, and Trim
    5. Missing and multiple values
      1. COALESCE and COALESCEC
    6. Interval calculations
      1. INTNX and INTCK
    7. Concatenation
      1. CAT
      2. CATS, CATT, and CATX
      3. LAGS
    8. Logic and control
      1. IFC and IFN
      2. WHICHC or WHICHN
      3. CHOOSEC or CHOOSEN
    9. Number manipulation
      1. CEIL, FLOOR, INT, and ROUND
    10. Summary
  9. Section 2: Merging, Optimizing, and Descriptive Statistics
  10. Combining, Indexing, Encryption, and Compression Techniques Simplified
    1. Introduction to combining
      1. Concatenating
      2. Interleaving
      3. Merging
      4. Updating
      5. Modifying
    2. Concatenation
      1. Different variable length and additional variables
      2. Duplicate values
      3. Different data types
      4. Leveraging the temporary variable
      5. PROC APPEND
    3. Interleaving
    4. Merging
      1. By Matching
      2. Overlapping variables
      3. One-to-many merging
      4. Program data vector
      5. Many-to-many merging
    5. Indexing
      1. Unique values
      2. Missing values
    6. Encryption
    7. Summary
  11. Power of Statistics, Reporting, Transforming Procedures, and Functions
    1. Proc Freq
      1. Cross tabulation
      2. Restricting Proc Freq output
      3. Cross tabulation with a controlling variable
      4. Proc Freq and statistical tests
    2. Proc Univariate
      1. Basic statistics and extreme observations
      2. Tests of normality
      3. Tests for location
    3. Proc Means and Summary
      1. Proc Means
      2. Proc Summary
    4. Proc Corr
    5. Proc REG
    6. Proc Transpose
    7. Summary
  12. Section 3: Advanced Programming
  13. Advanced Programming Techniques - SAS Macros
    1. What are macros?
    2. Macro variable processing
    3. Macro resolution tracking
    4. Macro definition processing
    5. Comparing positional and keywords parameters
    6. Data-driven programming
    7. Leveraging automatic global macro variables
    8. Macros that evaluate
    9. Writing efficient macros
    10. Summary
  14. Powerful Functions, Options, and Automatic Variables Simplified
    1. NOMPREPLACE and MREPLACE
    2. NOMCOMPILE and NCOMPILE
    3. MCOMPILENOTE
    4. NOMEXECNOTE and MEXECNOTE
    5. MAUTOCOMPLOC
    6. MACRO and NOMACRO
      1. Available macro functions 
    7. Exchanging values between the DATA step and macro variables
      1. Choosing between CALL SYMGET and CALL SYMPUT
    8. CALL EXECUTE
    9. Altering the CALL SYMPUT example
    10. Resolving macro variables
      1. Macro variable names within text
      2. Macro variables and libraries
      3. Indirect macro referencing
      4. Series of macro variable references with a single macro call
      5. Multiple ampersands
    11. Macro quoting
      1. Using the %STR quote
      2. Using the %NRSTR quote
      3. Using the %BQOUTE and %NRBQOUTE quotes
    12. Summary
  15. Section 4: SQL in SAS
  16. Advanced Programming Techniques Using PROC SQL
    1. Comparing data steps and Proc SQL
    2. Proc SQL joins
      1. Inner join
      2. Left join
      3. Right join
      4. Full join
      5. One-to-many join
      6. Many-to-many join
    3. Proc SQL essentials
      1. Subsetting
      2. Grouping and summarizing
    4. Dictionary tables
    5. Summary
  17. Deep Dive into PROC SQL
    1. SAS views in Proc SQL
      1. SQL views syntax
      2. Describing views
      3. Optimizing performance using views
    2. Making changes with Proc SQL
      1. Deleting
      2. Altering
    3. Identifying duplicates using Proc SQL
    4. Creating an index in Proc SQL
    5. Macros and Proc SQL
      1. Creating a macro variable using Into
      2. Creating multiple macro variables using Into
    6. Summary
  18. Section 5: Data Visualization and Reporting
  19. Data Visualization
    1. The role of data visualization in analytics
    2. Histograms
    3. Line plots
    4. Vertical and horizontal bar charts
    5. Scatter charts
    6. Box plot
    7. Summary
  20. Reporting and Output Delivery System
    1. Proc Tabulate
      1. Comparing multiple Proc Means and Proc Tabulates
      2. Multiple tables using Proc Tabulate
      3. Choosing the statistics
      4. Formatting the output
      5. Two-dimensional output
    2. Specifying the ODS destination
    3. Formatting ODS files
      1. Multiple sheets
      2. Applying filters
      3. Controlling the print options
      4. Changing the default cells
    4. ODS Excel charts
      1. Color-coding the output
      2. Copying over the formula
    5. Summary
  21. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Hands-On SAS for Data Analysis
  • Author(s): Harish Gulati
  • Release date: September 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781788839822