Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Mastering SAS Programming for Data Warehousing
Mastering SAS Programming for Data Warehousing

Mastering SAS Programming for Data Warehousing: An advanced programming guide to designing and managing Data Warehouses using SAS

eBook
₱1571.99 ₱2245.99
Paperback
₱2806.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Mastering SAS Programming for Data Warehousing

Chapter 1: Using SAS in a Data Mart, Data Lake, or Data Warehouse

The purpose of this chapter is to showcase how SAS has been used in data warehousing over its lifetime, and how that history impacts SAS data warehousing today. It provides an opportunity to see how slight changes in coding in SAS data steps can greatly impact data input/output (I/O). It also covers how SAS data is managed, and how Base SAS, the analytic component, interacts with stored data.

As SAS developed, there became a need to set indexes on variables, and to use SQL coding in SAS. How PROC SQL in SAS compares with data steps and other SQL programming will be reviewed in this chapter. I will also explain strategies to deal with memory issues in SAS, and how it has evolved to now be used with data in the cloud.

In this chapter, we are going to cover the following main topics:

  • How early versions of SAS handled data

  • Different ways to access data in SAS

  • Considerations in improving I/O in SAS

  • ...

Technical requirements

The dataset used as a demonstration in this chapter, in *.csv format, can be found online on GitHub: https://github.com/PacktPublishing/Mastering-SAS-Programming-for-Data-Warehousing/blob/master/Chapter%201/Datasets/Chap%201_1_Infile.csv.

The code bundle for this chapter is available on GitHub here: https://github.com/PacktPublishing/Mastering-SAS-Programming-for-Data-Warehousing/tree/master/Chapter%201.

Using original versions of SAS

Initially, SAS data had to be input through code into memory whenever analysis code was to be run on the data. This section covers the following:

  • How to enter data into SAS datasets using SAS

  • The early PROCs developed, such as PROC PRINT and PROC MEANS

  • Improvements to data handling made in Base SAS

In this section, you will learn how SAS's data management processes were initially developed. The processes impact how SAS runs today.

Initial SAS data handling

As described on SAS's website (https://www.sas.com/en_us/company-information/profile.html), SAS was invented in 1966 as the Statistical Analysis System, developed under a grant from the United States (US) National Institutes of Health (NIH) to eight universities. The immediate need was to develop a computerized system that could analyze the large amount of agriculture data being collected through the US Department of Agriculture (USDA).

According to the SAS...

Accessing data in SAS

This section covers how accessing data in SAS changed over the years:

  • First, SAS data storage moved from punch cards to mainframes.

  • Next, the invention of personal computers (PCs) led to reconfiguring how SAS data was accessed.

  • Consequently, reading data into SAS from external data files became more common.

In this section, we will discuss how to read data in SAS from an external file, as well as the opportunities and limitations of how SAS processes data.

Upgrading to mainframes

In 1979, Databank of New Zealand adapted SAS to run under IBM's VM/CMS system using IBM's disk operating system (DOS), thus solving the punch card problem and establishing SAS as mainframe software that was remotely hosted. This represented essentially the second rewrite of SAS since its 1976 rewrite. This upgrade made SAS more easily accessible to more customers. It also facilitated the ability for SAS to include more sophisticated components to...

Improving I/O

Although SAS has created many features to improve data warehousing, it is still necessary to improve I/O through the strategic use of SAS code. This section will cover the following:

  • Features for warehousing that have been developed by SAS

  • The importance of using the WHERE rather than the IF clause in data processing

  • How sorting and indexing can be done to improve I/O in SAS

Developing warehouse environments

The 1990s saw people working with SAS and big data to find creative solutions to improve data I/O. In his 1997 SAS white paper (available under Further reading), Ian Robertson describes the benefits of his case study migrating the Wisconsin Department of Transportation Traffic Safety and Record-keeping System (TSRS) from a mainframe SAS setup to one where data was served up to analysts through a local area network (LAN).

By this time, SAS had been reconfigured to run on their LAN's operating system, OS/2, so his team was able to save...

Dealing with storage and memory issues

This section will cover issues with storage and memory when using SAS for big data. It will cover the following:

  • How SAS dealt with competition from structured query language (SQL) for data storage

  • How PROC SQL works and can be used in data warehouse processing

  • Considerations about memory and storage that need to be made when using SAS in a data warehouse in modern times

  • How SAS can work in the cloud

Avoiding memory issues

Even as SAS got more powerful, datasets kept getting bigger, and there were always challenges with running out of memory during processing. For example, using WHERE instead of IF when reading in data would not only reduce CPU usage and the time it took for code to run, it would also prevent unnecessary usage of memory. Even today, tuning SAS code may be necessary to avoid memory issues.

In a data warehouse, mart, or lake, datasets that were transformed in SAS may be stored outside of SAS in SAS...

Using SAS in modern warehousing

Today, SAS data warehousing is more complicated than it was in the past because there are so many options. Learning about these options can help the user envision the possibilities, and design a SAS data warehousing system that is appropriate for their organization's needs. This section will cover the following:

  • A modern case study that used SAS components for analyzing unstructured text in helpdesk tickets

  • A case study of a data SAS warehouse that upgraded an old system to include a new API allowing users more visualization functionality through SAS Visual Analytics

  • A case study of a legacy SAS shop that began to incorporate R into their system

  • A review of how SAS connects with a new cloud storage system, Snowflake

Warehousing unstructured text

In his white paper on warehousing unstructured text in SAS, Nick Evangelopoulos describes how the IT Shared Services (ITSS) division at the University of North Texas (UNT) used...

Summary

This chapter provided a short history of SAS, focusing on how it has been used for data storage and analysis over the years. Initially, SAS data was stored on punch cards. Once data became electronic, the main challenge to SAS users working with big data was I/O. As SAS environments evolved from being on mainframes to being accessible by PCs, SAS developed new products and services to complement its core analytics and data management functions.

SAS data steps are procedural, and allow the programmer opportunities to greatly improve I/O through the use of certain commands, features, and approaches to programming. When SQL became popular, PROC SQL was invented. This allowed SAS users to choose between using data steps or SQL commands when managing data in SAS.

Today, SAS is still used in data warehousing, but there are new challenges with accessing data in the cloud. SAS data warehouses today can include predominantly SAS components, such as SAS VA and CAS. Or, SAS can...

Questions

  1. What is the difference between SAS and SQL with respect to data handling?

  2. What is the difference between subsetting datasets using WHERE compared to the IF clause?

  3. What is the component of SAS that allows it to connect to non-SAS databases?

  4. Under what circumstance should you place an index on a variable in a large dataset?

  5. Should you use SAS to enter a small dataset through data steps? State the reason for your answer.

  6. What is the main advantage of using all SAS components in your warehouse?

  7. What is a good way to decide whether to use a data step or PROC SQL for a particular data editing task?

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand how to use SAS macros for standardizing extract, transform, and load (ETL) protocols
  • Develop and use data curation files for effective warehouse management
  • Learn how to develop and manage ETL, policies, and print and web reports that meet user needs

Description

SAS is used for various functions in the development and maintenance of data warehouses, thanks to its reputation of being able to handle ’big data’. This book will help you learn the pros and cons of storing data in SAS. As you progress, you’ll understand how to document and design extract-transform-load (ETL) protocols for SAS processes. Later, you’ll focus on how the use of SAS arrays and macros can help standardize ETL. The book will also help you examine approaches for serving up data using SAS and explore how connecting SAS to other systems can enhance the data warehouse user’s experience. By the end of this data management book, you will have a fundamental understanding of the roles SAS can play in a warehouse environment, and be able to choose wisely when designing your data warehousing processes involving SAS.

Who is this book for?

This book is for data architects, managers leading data projects, and programmers or developers using SAS who want to effectively maintain a data lake, data mart, or data warehouse.

What you will learn

  • Develop efficient ways to manage data input/output (I/O) in SAS
  • Create and manage extract, transform, and load (ETL) code in SAS
  • Standardize ETL through macro variables, macros, and arrays
  • Identify data warehouse users and ensure their needs are met
  • Design crosswalk and other variables to serve analyst needs
  • Maintain data curation files to improve communication and management
  • Use the output delivery system (ODS) for print and web reporting
  • Connect other products to SAS to optimize storage and reporting
Estimated delivery fee Deliver to Philippines

Standard delivery 10 - 13 business days

₱492.95

Premium delivery 5 - 8 business days

₱2548.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 16, 2020
Length: 494 pages
Edition : 1st
Language : English
ISBN-13 : 9781789532371
Category :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Estimated delivery fee Deliver to Philippines

Standard delivery 10 - 13 business days

₱492.95

Premium delivery 5 - 8 business days

₱2548.95
(Includes tracking information)

Product Details

Publication date : Oct 16, 2020
Length: 494 pages
Edition : 1st
Language : English
ISBN-13 : 9781789532371
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 9,696.97
Odoo 14 Development Cookbook
₱4082.99
Hands-On SAS for Data Analysis
₱2806.99
Mastering SAS Programming for Data Warehousing
₱2806.99
Total 9,696.97 Stars icon

Table of Contents

17 Chapters
Section 1: Managing Data in a SAS Data Warehouse Chevron down icon Chevron up icon
Chapter 1: Using SAS in a Data Mart, Data Lake, or Data Warehouse Chevron down icon Chevron up icon
Chapter 2: Reading Big Data into SAS Chevron down icon Chevron up icon
Chapter 3: Helpful PROCs for Managing Data Chevron down icon Chevron up icon
Chapter 4: Managing ETL in SAS Chevron down icon Chevron up icon
Chapter 5: Managing Data Reporting in SAS Chevron down icon Chevron up icon
Section 2: Using SAS for Extract-Transform-Load (ETL) Protocols in a Data Warehouse Chevron down icon Chevron up icon
Chapter 6: Standardizing Coding Using SAS Arrays Chevron down icon Chevron up icon
Chapter 7: Designing and Developing ETL Code in SAS Chevron down icon Chevron up icon
Chapter 8: Using Macros to Automate ETL in SAS Chevron down icon Chevron up icon
Chapter 9: Debugging and Troubleshooting in SAS Chevron down icon Chevron up icon
Section 3: Using SAS When Serving Warehouse Data to Users Chevron down icon Chevron up icon
Chapter 10: Considering the User Needs of SAS Data Warehouses Chevron down icon Chevron up icon
Chapter 11: Connecting the SAS Data Warehouse to Other Systems Chevron down icon Chevron up icon
Chapter 12: Using the ODS for Visualization in SAS Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(5 Ratings)
5 star 60%
4 star 20%
3 star 20%
2 star 0%
1 star 0%
Murphy Choy Jun 15, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I believe the book provides a very comprehensive insight into the process of building a data warehouse and how SAS can be used to develop one. Many useful tricks and tips will help folks building their first data warehouse. Highly recommended as a classic reference.
Amazon Verified review Amazon
Roger Nov 06, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book provides background, examples, rationale, and the pros/cons of using SAS in the areas of ETL, data management, policy development, and more. By providing some historical context, Wahi creates a foundation to better understand the development and application of certain SAS statements over time. She explains multiple ways of how to perform a task while providing examples of code, log, and output. She provides detailed explanations of code, provides data to support one method over another, and explains the pros and cons of each method. Through the plethora of examples, she points out the nuances in the various data file types, code, and logs, and she addresses naming tips for data and code along the way. Not only does the book’s coding examples and explanations provide a methodology for data management, but she also discusses important considerations and rationale in setting up policy regarding data management.The reader should probably have some basic foundation in SAS or be currently learning it. The book is written for both active and passive learning. She provides data and code to practice while reading; however, the code, logs, and output are in the book which allows one to follow along and see and compare the results without doing the hands-on component. Although some of the deeper computer language might be over the head of a novice, it provides brief snippets of detail for the more experienced SAS programmer while not losing the interest of those less experienced. Additionally, even with little knowledge of data management or ETL, this book is extremely beneficial in truly understanding the benefits and limitations of various statements and in having examples well-explained, thereby, serving as references. Additionally, each chapter is enhanced with a brief chapter outline in the beginning and ends with a summary and questions to challenge the reader with application-level questions.
Amazon Verified review Amazon
Gracie Nov 19, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have followed Dr. Wahi’s teachings for over two years. I still use some of her codes for my healthcare data analysis in SAS. When I came across a book, I knew it would be a wonderful book. This book covers practical SAS programming. The book starts with good explanations of the concepts of big data, important terminologies. Then it reviews the basic SAS programming and its essential functions for data managing such as importing and exporting data, exploratory data analysis, data visualization. Next, it enters to more advanced topics SQL and macros, and ETL. The explanations are filled with essential concepts, practical examples, and questions.Monika Wahi has converted a difficult subject into something that is enjoyable to read. The authors do a fine job of explaining each process, when to use it, and how to interpret the results. Their examples are easy to understand, and the tips they provide are helpful.
Amazon Verified review Amazon
Alexandre Santos Guedes Oct 30, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
First, I have to say that I'm an R Language learner and I haven't used SAS before. I was worried about it because I don't have access to the SAS server paid edition. However, the book already starts explaining to the reader where to find a free edition of the SAS server. It is a plus for the book.It also brings many examples and exercises that guide the readers to improve their SAS skills.I suggest improvements to the layout of the images, tables, and graphs for the next editions.In conclusion, I recommend the book.
Amazon Verified review Amazon
Anandaroop Jan 29, 2021
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
The so called "new" book had a crease on the coverpage
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela