This book will take you from complete novice to confident competence with the new SAS programming language, DS2.
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 power and control of the DATA step with the ease, flexibility, and rich data type palette of SQL might be just what you are looking for! DS2 plays well with multiple data sources, and is exceptionally well suited for manipulating data on massively parallel platforms (MPPs), including SAS Viya’s SAS Cloud Analytic Services (CAS), Hadoop, Greenplum, and Teradata.
DS2 gives you the power to accomplish tasks such as these:
● process traditional SAS data sets and DBMS data tables containing full-precision ANSI data types, all in the same DS2 data program.
● easily create and share reusable code modules.
● create custom objects and use object-oriented programming techniques.
● safely and simply process multiple rows of data in parallel using Base SAS.
● manipulate data with DS2 programs while fully leveraging the massively parallel processing capabilities of CAS.
● Execute DS2 programs in-database on Hadoop, Greenplum, and Teradata.
This book assumes reader proficiency in these topics:
● DATA step programming:
◦ SAS libraries
◦ accessing data with a LIBNAME statement
◦ reading and writing SAS data sets
◦ the role of the program data vector (PDV) in DATA step processing
◦ conditional processing techniques
◦ arrays
◦ iterative processing (DO loops)
● macro processing:
◦ assigning values to macro variables
◦ resolving macro variables in SAS code
◦ timing of macro process execution versus execution of other SAS code
● SQL joins
This book covers the following topics:
● the types of processes for which the language was designed and the conditions indicating when DS2 would be a good choice for improving process performance
● programming statements and functions shared between traditional DATA steps and DS2 data programs
● DATA step functionality that is not available in DS2
● new DS2 functionality that is not available in the traditional DATA step
● manipulating ANSI data types at full precision in DS2
● converting traditional Base SAS DATA steps to DS2 data programs
● creating reusable code modules in DS2 and packaging them for easy reuse
● using DS2 packages to create object-oriented programs
● creating DS2 thread programs for parallel processing of data records
● executing DS2 thread programs distributed on MPP DBMS platforms
SAS 9.4M5
The majority of the programs in this book use only Base SAS and were developed with SAS University Edition.
● The programs that read and write to DBMS also required these solutions:
◦ SAS/ACCESS Interface to Teradata
◦ SAS In-Database Code Accelerator for Teradata
All DBMS data was stored in Teradata Express 15.0.
The primary references used in writing this book include the following SAS 9.4 documentation:
● SAS® 9.4 DS2 Language Reference
● SAS® 9.4 DATA Step Statements: Reference
● SAS® 9.4 Functions and CALL Routines: Reference
● SAS® 9.4 FedSQL Language Reference
● DS2 Programming: Essentials course notes
To access this book’s example code and data, go to the author page at http://support.sas.com/publishing/authors. Select the name of the author. Then, select “Example Code and Data” from the list of links.
If you are unable to access the code through the website, send email to [email protected].
If you are using SAS University Edition to access data and run your programs, check the SAS University Edition page to ensure that the software contains the product or products that you need to run the code.
Most of the programs in this book require only Base SAS to execute and will run just fine in SAS University Edition. However, a few programs read from or write to Teradata tables. These programs cannot be executed in SAS University Edition, because the SAS/ACCESS Interface to Teradata is not included. A list of the SAS software products that are included with SAS University Edition is available at http://support.sas.com/software/products/university-edition/index.html.
All output and SAS graphics in this book were produced by executing the associated program code from SAS Studio on SAS 9.4M5.
Although this book illustrates many analyses regularly performed in businesses across industries, questions specific to your aims and issues may arise. To fully support you, SAS and SAS Press offer you the following resources:
● For questions about topics covered in this book, contact the author through SAS Press:
◦ Send questions by email to [email protected]; include the book title in your correspondence.
◦ Submit feedback on the author’s page at http://support.sas.com/author_feedback.
● For questions about topics beyond the scope of this book, post queries to the relevant SAS Support Communities at https://communities.sas.com/welcome. The Base SAS programming community is the appropriate community for questions about DS2.
● SAS maintains a comprehensive website with up-to-date information. One page that is particularly useful to both the novice and to the seasoned SAS user is the Knowledge Base. Search for relevant notes in the “Samples and SAS Notes” section of the Knowledge Base at http://support.sas.com/resources.
● Registered SAS users or their organizations can access SAS Customer Support at http://support.sas.com. Here you can pose specific questions to SAS Customer Support; under Support, click Submit a Problem. You must provide an email address to which replies can be sent, identify your organization, and provide a customer site number or license information. This information can be found in your SAS logs.
We look forward to hearing from you. We invite questions, comments, and concerns. If you want to contact us about a specific book, please include the book title in your correspondence.
● By email: [email protected]
● Via the web: http://support.sas.com/author_feedback
● Visit sas.com/store/books.
● Phone 1-800-727-0025
● Email [email protected]
Receive up-to-date information about SAS training, certification, and publications via email by subscribing to the SAS Learning Report monthly eNewsletter. Read the archives and subscribe today at http://support.sas.com/community/newsletters/training!
SAS is recruiting authors! Are you interested in writing a book? Visit http://support.sas.com/saspress for more information.