Mastering the SAS DS2 Procedure
144 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Mastering the SAS DS2 Procedure , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
144 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description



Enhance your SAS data-wrangling skills with high-precision and
parallel data manipulation using the DS2 programming language.



Now in its second edition, this book addresses the DS2 programming language
from SAS, which combines the precise procedural power and control of the
Base SAS DATA step language with the simplicity and flexibility of SQL. DS2
provides simple, safe syntax for performing complex data transformations in
parallel and enables manipulation of native database data types at full
precision. It also covers PROC FEDSQL, a modernized SQL language that
blends perfectly with DS2. You will learn to harness the power of parallel
processing to speed up CPU-intensive computing processes in Base SAS and
how to achieve even more speed by processing DS2 programs on massively
parallel database systems. Techniques for leveraging internet APIs to
acquire data, avoiding large data movements when working with data from
disparate sources, and leveraging DS2's new data types for full-precision
numeric calculations are presented, with examples of why these techniques
are essential for the modern data wrangler.



Here's what's new in this edition:





  • how to significantly improve performance by using the new SAS
    Viya architecture with its SAS Cloud Analytic Services (CAS)





  • how to declare private variables and methods in a package





  • the new PROC DSTODS2





  • the PCRXFIND and PCRXREPLACE packages





While working though the code samples provided with this book, you will
build a library of custom, reusable, and easily shareable DS2 program
modules, execute parallelized DATA step programs to speed up a
CPU-intensive process, and conduct advanced data transformations using hash
objects and matrix math operations.



This book is part of the SAS Press Series.


Sujets

Informations

Publié par
Date de parution 23 mars 2018
Nombre de lectures 1
EAN13 9781635266061
Langue English
Poids de l'ouvrage 20 Mo

Informations légales : prix de location à la page 0,0092€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

The correct bibliographic citation for this manual is as follows: Jordan, Mark. 2018. Mastering the SAS DS2 Procedure: Advanced Data-Wrangling Techniques, Second Edition . Cary, NC: SAS Institute Inc.
Mastering the SAS DS2 Procedure: Advanced Data-Wrangling Techniques, Second Edition
Copyright 2018, SAS Institute Inc., Cary, NC, USA
ISBN 978-1-63526-609-2 (Hard copy) ISBN 978-1-63526-606-1 (EPUB) ISBN 978-1-63526-607-8 (MOBI) ISBN 978-1-63526-608-5 (PDF)
All Rights Reserved. Produced in the United States of America.
For a hard copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc.
For a web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication.
The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic piracy of copyrighted materials. Your support of others rights is appreciated.
U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer software developed at private expense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication, or disclosure of the Software by the United States Government is subject to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR 227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S. federal law, the minimum restricted rights as set out in FAR 52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provision serves as notice under clause (c) thereof and no other notice is required to be affixed to the Software or documentation. The Government s rights in Software and documentation shall be only those set forth in this Agreement.
SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414
March 2018
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration.
Other brand and product names are trademarks of their respective companies.
SAS software may be provided with certain third-party software, including but not limited to open-source software, which is licensed under its applicable third-party software license agreement. For license information about third-party software distributed with SAS software, refer to http://support.sas.com/thirdpartylicenses .
Dedication
To Ron Cody, SAS guru and author extraordinaire-your advice and encouragement finally made me believe I could do it.
To the amazing folks at SAS Press who were always there when I needed them. Without your constant and cheerful support, this book would have never been written.
To Lori, my love-without your love and encouragement, I d have given up hope! Thanks for keeping the faith and urging me on.
And finally, to Tiger Man, the world s friendliest cat-your enthusiasm and snuggling abilities are legend, but your typing skills could still use improvement...
Contents
Dedication
Foreword
About This Book
About the Author
Chapter 1: Getting Started
1.1 Introduction
1.1.1 What is DS2?
1.1.2 Traditional SAS DATA Step versus DS2
1.1.3 What to Expect from This Book
1.1.4 Prerequisite Knowledge
1.2 Accessing SAS and Setting Up for Practice
Chapter 2: Introduction to the DS2 Language
2.1 Introduction
2.2 DS2 Programming Basics
2.2.1 General Considerations
2.2.2 Program Structure
2.2.3 Procedure Options and Global Statements
2.2.4 Program Blocks
2.2.5 Methods
2.2.6 User-Defined Methods
2.2.7 Variable Identifiers and Scope
2.2.8 Data Program Execution
2.3 Converting a SAS DATA Step to a DS2 Data Program
2.3.1 A Traditional SAS DATA Step
2.3.2 Considerations
2.3.3 The Equivalent DS2 Data Program
2.3.4 More Complex Data Program Processing
2.3.5 Automatic Conversion with PROC DSTODS2
2.4 Review of Key Concepts
Chapter 3: DS2 Data Program Details
3.1 Introduction
3.2 DS2 Data Programs versus Base SAS DATA Steps
3.2.1 General Considerations
3.2.2 The Seven Subtle Dissimilarities
3.2.3 DS2 Missing Features
3.3 Data Types in DS2
3.3.1 DS2 and ANSI Data Types
3.3.2 Automatic Data Type Conversion
3.3.3 Non-coercible Data Types
3.3.4 Processing SAS Missing and ANSI Null Values
3.4 Review of Key Concepts
Chapter 4: User-Defined Methods and Packages
4.1 Introduction
4.2 Diving into User-Defined Methods
4.2.1 Overview
4.2.2 Designing a User-Defined Method
4.3 User-Defined Packages
4.3.1 General Considerations
4.3.2 User-Defined Package Specifics
4.4 Object-Oriented Programming with DS2 Packages
4.4.1 General Considerations
4.4.2 Designing an Object
4.4.3 Using Objects as Building Blocks
4.4 Review of Key Concepts
Chapter 5: Predefined Packages
5.1 Introduction
5.2 Executing FCMP Functions in DS2
5.2.1 The FCMP Package
5.2.2 FCMP Package Example
5.3 The Hash and Hiter (Hash Iterator) Packages
5.3.1 General
5.3.2 Hash Package Example
5.3.3 Hash Iterator Package Example
5.4 The HTTP and JSON Packages
5.4.1 General
5.4.2 HTTP Package Specifics
5.4.3 JSON Package Specifics
5.4.4 HTTP and JSON Packages Example
5.5 The Matrix Package
5.5.1 General
5.5.2 Matrix Package Example
5.6 The PCRXFIND and PCRXREPLACE Packages
5.6.1 General
5.6.2 PCRXFIND and PCRXREPLACE Package Examples
5.7 The SQLSTMT Package
5.7.1 General
5.7.2 SQLSTMT Package Example
5.8 The TZ (Time Zone) Package
5.8.1 General
5.8.2 TZ Package Example
5.9 Review of Key Concepts
Chapter 6: Parallel Processing in DS2
6.1 Introduction
6.2 Understanding Threaded Processing
6.2.1 The Need for Speed
6.2.2 Loading Data to and from RAM
6.2.3 Manipulating Data in RAM
6.3 DS2 Thread Programs
6.3.1 Writing DS2 Thread Programs
6.3.2 Parallel Processing Data with DS2 Threads
6.4 DS2 and the SAS In-Database Code Accelerator
6.4.1 DS2 Program In-Database Processing
6.5 DS2 and SAS Viya and SAS Cloud Analytic Services (CAS)
6.5.1 A Brief Introduction to SAS Viya and CAS
6.5.2 Running DS2 Programs in CAS
6.6 Review of Key Concepts
Chapter 7: Performance Tuning in DS2
7.1 Introduction
7.2 DS2_OPTIONS Statement
7.2.1 TRACE Option
7.3 Analyzing Performance with the SAS Log
7.3.1 Obtaining Performance Statistics
7.3.2 Analyzing Performance Statistics
7.3.3 Tuning Your Code
7.4 Learning and Troubleshooting Resources
7.4.1 SAS Learning Resources
7.4.2 SAS Support Communities
7.4.3 SAS Technical Support
7.5 Review of Key Concepts
7.6 Connecting with the Author
Index
Foreword
In my many years of managing the development of some of the core data manipulation languages of SAS, such as the DATA step, DS2, PROC SQL, and FedSQL, I have come to appreciate the value of education. It doesn t matter how good the technology is if it is not understood by the people it is intended to benefit. And simply collecting the facts into a volume is not the same as teaching a subject.
With his new book, Mastering the SAS DS2 Procedure: Advanced Data-Wrangling Techniques, Second Edition , Mark has succeeded in providing an extremely concise introduction to not only the syntax of the SAS DS2 language but, more importantly, to the objectives of the language. He builds his examples systematically in a way that keeps readers turning pages at a satisfying pace. The DATA-step-to-DS2 comparison that he includes helps seasoned SAS programmers quickly find their bearings in the new language but at the same time does not require readers to be DATA step experts to learn DS2.
His coverage of the DS2 package library is especially valuable since these large functional blocks illustrate one of the key design principles of DS2: packages allow for the expansion of the language capabilities with large-scale components that are supplied by SAS or written by the user. The focus on parallel execution is timely in this age of exploding data volumes and grid-based computing, and DS2 is well suited for the new parallel world, especially with the latest extension of the SAS platform, SAS Viya and SAS Cloud Analytic Services (CAS).
Finally, I particularly like Mark s personal anecdotes relating to his journey with the language, finding what is missing, what is different, and what is unique and why. I regard Mark as an extended part of the DS2 design team and value his input on how the language can be improved in the future.
Robert Ray Director, Research and Development (Retired) SAS Institute Inc. Cary, North Carolina
About This Book
Purpose
This book will take you from complete novice to confident competence with the new SAS programming language, DS2.
Is This Book for You?
Are you comfortable with traditional Base SAS DATA step and SQL processing? Want to supercharge your data preparation? Then DS2, the new SAS programming language that integrates the po

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents