You are previewing The DS2 Procedure: SAS Programming Methods at Work.
O'Reilly logo
The DS2 Procedure: SAS Programming Methods at Work

Book Description

The issue facing most SAS programmers today is not that data space has become bigger ("Big Data"), but that our programming problem space has become bigger. Through the power of DS2, this book shows programmers how easily they can manage complex problems using modular coding techniques. The DS2 Procedure: SAS Programming Methods at Work outlines the basic structure of a DS2 program and teaches you how each component can help you address problems. The DS2 programming language in SAS 9.4 simplifies and speeds data preparation with user-defined methods, storing methods and attributes in shareable packages, and threaded execution on multicore symmetric multiprocessing (SMP) and massively parallel processing (MPP) machines. This book is intended for all BASE SAS programmers looking to learn about DS2; readers need only an introductory level of SAS to get started. Topics covered include introductions to Object Oriented Programming methods, DATA step programs, user-defined methods, predefined packages, and threaded processing.

Table of Contents

  1. Preface
  2. About This Book
  3. About The Author
  4. Chapter 1: Solving Bigger Problems
  5. big data. Big data. BIG DATA
  6. PROC DS2
  7. Problem Space
    1. Clarity
    2. Scope
    3. Modularity and Encapsulation
    4. Data Types
  8. Data Space
    1. Embedded SQL
    2. Threaded Data Access
    3. In-Database Processing
  9. Our First DS2 Programs
    1. PROC DS2 as a DATA Step Equivalent
  10. Chapter 2: Object-Oriented Programming for SAS Programmers
  11. Background and Definition
    1. Dog Class
  12. An Example of OOP
  13. Moving Forward
  14. Chapter 3: Variables and Data Types
    1. Variable Names
    2. DECLARE Statement
    3. DATA Step Conversion—Numerics
    4. DATA Step Conversion—Characters
    5. DATA Step Conversion—Date Types
    6. DATA Step Conversion—Binary Types
    7. DATA Step Conversion—Saving Your Table
    8. More about Dates
  15. Operations and Assignments
    1. IF Operator
    2. SELECT Operator
  16. Arrays
    1. Temporary Arrays
    2. Variable Arrays
    3. Deferred Dimensioning
    4. Array Dimensions
    5. Array Assignment
  17. Missing Values and NULL Values
    1. ANSI Mode and SAS Mode
    2. Testing for Missing or NULL Values
  18. Chapter 4: Scope
  19. Scope
  20. The Program Data Vector (PDV)
    1. KEEP and DROP
  21. Scope in Other Programming Blocks
  22. Chapter 5: Methods
  23. Defining Methods
    1. System-Defined Methods
    2. User-Defined Methods
    3. Recursion
  24. Chapter 6: Packages
  25. User-Defined Packages
    1. Instantiation
    2. Using a Package Variable
    3. Package as Object
    4. Packages and Scope
    5. Package as Method Parameter and Method Return Variable
  26. System-Defined Packages
    1. FCMP Package
    2. TZ Package
  27. Chapter 7: An Example
  28. Problem
  29. The Hash Package
    1. Four Steps to Creation
    2. Lookup and Retrieval
  30. Problem Revisited
    1. Threaded Read
    2. Parameterized Threaded Read
  31. Chapter 8: Data Sources
  32. Overview
  33. Sample Tables
  34. SET
    1. SET Data Set Options
    2. SET with No BY Statement
    3. SET with BY Statement
    4. SET with FedSQL as a Data Source
  35. Merge
    1. Merge with FedSQL as a Data Source
  36. Threads
    1. Thread Methods
    2. Thread Parameters
  37. SQLSTMT Package
    1. SQLSTMT Binding
    2. SQLSTMT – Returning the Rows
  38. References
  39. Index