25,99 €
Become data-savvy with the widely used data and AI software
Data and analytics are essential for any business, giving insight into what's working, what can be improved, and what else needs to be done. SAS software helps you make sure you're doing data right, with a host of data management, reporting, and analysis tools. SAS For Dummies teaches you the essentials, helping you navigate this statistical software and turn information into value. In this book, learn how to gather data, create reports, and analyze results. You'll also discover how SAS machine learning and AI can help deliver decisions based on data. Even if you're brand new to data and analytics, this easy-to-follow guide will turn you into an SAS power user.
This is the perfect Dummies guide for new SAS users looking to improve their skills—in any industry and for any organization size.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 500
Veröffentlichungsjahr: 2025
Cover
Title Page
Copyright
Introduction
About This Book
Foolish Assumptions
Icons Used in This Book
Beyond the Book
Part 1: Welcome to SAS!
Chapter 1: Touring the Wonderful World of SAS
So, What Is SAS and Who Uses It?
Myth: You Need to Be a Programmer to Use SAS
Checking Out Real-World Success Stories
Chapter 2: All Shapes and Sizes: Your SAS Is Beautiful
Introducing SAS Enterprise Guide, the Swiss Army Knife of SAS
SAS Studio: Your SAS Workshop in the Browser
SAS Viya Workbench: For the Discerning Programmer
Your Grandpa’s SAS: If It Ain’t Broke …
Chapter 3: Six-Minute Abs: Achieving Miraculous Results with SAS
Knowing Where Your My Data Set Is Coming From and Going
Querying Your Way to Success
Summarizing the Data
Summarizing Specific Numeric Variables
Building a Forecast
Chapter 4: SAS Programming for the Faint of Heart
Demystifying the SAS Program
Dancing the DATA Step
Following Procedures
A Micro Look at Macro Programming
Ask Your Data Questions Using SQL
Putting It All Together in a SAS Mashup
Part 2: Gathering Data and Presenting Information
Chapter 5: Accessing Data: Oh, the Choices!
Accessing the Data Hidden in Plain Sight: Microsoft Excel and Text Files
Supersizing with Server-Based Data
A Cloud-y Situation: Accessing Data on the Web
Chapter 6: Managing Data: I Can Do That?
Bringing Your Data Together and Making It Sing (or at Least Hum) with Queries
Editing, Sorting, Ranking, Transposing, and Other Data Contortions
Chapter 7: Show Me a Report in Less Than a Minute
Discovering Your Reporting Options
Data Listings and Summaries for the Listless
Chapter 8: Graphs: More Value with SAS
Graphing Basics
Creating Graphics in SAS
Graphs for Every Occasion
Creating Graphs with SAS
Part 3: Impressing Your Boss with Your AI Savvy
Chapter 9: A Painless Introduction to Analytics
Analytic Concepts That Are Useful for Everyone
Describing Your Data with Distribution Analysis
Analyzing Counts and Frequencies
Transforming Your Data for Further Use
Analyzing Basic Data with Correlation Techniques
Understanding ANOVA and Regression: No PhD Required!
Staying Alive with Survival Analysis
Understanding Complex Relationships with Multivariate Analysis
Forecasting: Using the Crystal Ball
Chapter 10: Machine Learning: Making the Leap from Guesses to Smart Decisions
Machine Learning or Statistics or AI: Which Is It?
Just the Right Fit with Training Data
Sampling and Simulation: Picking the Right Bunch
Supervised versus Unsupervised: Machine Learning Algorithms Unleashed
Score Code in SAS: Your Secret Weapon
Real-Life Examples: How Machine Learning Shapes Your Life
Part 4: Enhancing and Sharing Your SAS Masterpieces
Chapter 11: Leveraging Work from SAS to Those Less Fortunate
Pulling Out Results without Pulling Teeth
Exporting Results, Duty-Free
Sharing SAS Results as a Report
Canning Your Work for Others to Use
Chapter 12: Pedal to Success on the Analytics Life Cycle
SAS Viya and the Analytics Life Cycle
Wrangling Your Data into Shape
Finding Your Top Model: Champions Compete
Strutting Your Stuff with a Production Model
Chapter 13: Supercharging Microsoft 365 with SAS
Using the Power of SAS from the Cozy World of Office
Understanding Which Microsoft 365 Applications Are Supported
Using SAS Content in Microsoft Excel
Refreshing and Managing SAS Content in Your Documents
Sharing Your Work with Others
Chapter 14: Seeing Is Believing in SAS Visual Analytics
Self-Service Reporting for Everyone
Creating Your First Report
Going Beyond Basic Reporting
Part 5: Getting SAS Ready to Rock and Roll
Chapter 15: Setting Up SAS
Assessing Your Situation
Keeping It Local
Distributing SAS to the Masses
Plunging Into Your Data
Chapter 16: Free and Easy Ways to Learn and Use SAS
SAS Environments That Are Free to Use
Elevating Your SAS Skills and Credentials
Chapter 17: New World Meets the Old: Programmers and the Low-Code Movement
Getting Organized with Projects and Flows
Letting SAS Tasks Do the Heavy Lifting
Keeping Off-Limits: Stuff That Won’t Work
Part 6: The Part of Tens
Chapter 18: Ten SAS Programming Productivity Tips
Using Snippets to Write Code in a Snap
Knowing the “Keys” to Success
Using AI Assistants to Write and Document Code
Creating SAS Macros for Repeatable Tasks
Don’t Create SAS Macros When They Aren’t Necessary
Using the DATA Step Debugger
Using Git for Source Management
Formatting Your Code with a Click
Using SAS Formats for Data Presentation and Categorization
Mixing Python and SAS by Using
proc python
Chapter 19: Ten (or So) Tips for SAS Administrators
Determining When SASUSER Isn’t Usable
Disarming Application Features
Making Your Database Work for You with Implicit Pass-Through
How Much Kubernetes Do You Need to Know?
Peering under the Covers with Process Logs in SAS 9.4
Monitoring System Health in SAS Viya
Enabling Git for SAS Programming Projects
Communicating with Your SAS Users
Chapter 20: Ten (or More) Web Resources for Extra Information
Where Do I Go for Support?
What Else Does SAS Offer and How Are Others Succeeding with SAS?
How Can I Connect with other SAS Users?
Where Can I Get More Info on Making Effective Charts and Graphs?
Where Can I Ask Questions?
Where Can I Discover More about Statistics and Analytics?
Where Can I Watch and Learn More about SAS?
Where Can I Find Information That Didn’t Fit in This Book?
Index
About the Author
Connect with Dummies
End User License Agreement
Chapter 3
TABLE 3-1 SAS Formats
TABLE 3-2 The Many Ways to Summarize Data in SAS
Chapter 4
TABLE 4-1 Examples of SAS Procedures
Chapter 5
TABLE 5-1 Frequently Used Data Access Methods
Chapter 9
TABLE 9-1 Chance of Various Outcomes from Tossing a Coin Ten Times
Chapter 1
FIGURE 1-1: One view of SAS: A program, log, and results shown in SAS Enterpris...
FIGURE 1-2: Also SAS! A designed report in SAS Visual Analytics.
Chapter 2
FIGURE 2-1: The welcoming SAS Enterprise Guide start screen.
FIGURE 2-2: A quad-box arrangement of the essential SAS elements: code, log, re...
FIGURE 2-3: The popular CARS data set and all its wonderful observations.
FIGURE 2-4: The Query Builder window is ready for action.
FIGURE 2-5: The start of a beautiful Process Flow, with input data, query step,...
FIGURE 2-6: SAS Studio, ready for action in SAS Viya.
FIGURE 2-7: A SAS Studio flow with input data and a Histogram step, ready to ru...
FIGURE 2-8: A histogram of the AgeAtDeath distribution from the HEART data. Not...
FIGURE 2-9: The SAS Studio Program window, a blank canvas for your brilliant co...
FIGURE 2-10: A stratified box plot of cholesterol measurements by smoking statu...
FIGURE 2-11: A SAS Notebook with multiple cells, like a fancy SAS code organism...
FIGURE 2-12: Pure Python in SAS Viya Workbench. What will they dream up next?
FIGURE 2-13: SAS for Microsoft Windows, a classic tool for classy SAS users.
Chapter 3
FIGURE 3-1: An example of a simple two-table join.
FIGURE 3-2: Browsing the Candy dataset via the data grid.
FIGURE 3-3: The Open Data dialog box from the Add Tables selection.
FIGURE 3-4: For now, don’t worry about this suitable join warning message.
FIGURE 3-5: The Tables and Joins dialog box with the described joins added.
FIGURE 3-6: The Query Builder task with the specified variables selected.
FIGURE 3-7: Rename a dataset here.
FIGURE 3-8: The Advanced Expression Editor awaits your input.
FIGURE 3-9: The Advanced Expression Editor with the net sales amount calculatio...
FIGURE 3-10: The Advanced Expression Editor with the completed net sales amount...
FIGURE 3-11: The Modify Additional Options page.
FIGURE 3-12: The Formats dialog box with the DOLLAR12.0 format specified.
FIGURE 3-13: The summary of the New Computed Column Wizard.
FIGURE 3-14: The newly created Quarterly_Sales_Summary dataset.
FIGURE 3-15: The Open a Task window, with access to hundreds of SAS tasks.
FIGURE 3-16: The Characterize Data Wizard.
FIGURE 3-17: The Characterize Data Wizard report.
FIGURE 3-18: The Data pane of the Summary Statistics task.
FIGURE 3-19: The Summary statistics and the box and whisker plot created with t...
FIGURE 3-20: The beer sales dataset.
FIGURE 3-21: The Basic Forecasting task, using the beer sales dataset.
FIGURE 3-22: Forecast Options settings for the Basic Forecasting task.
FIGURE 3-23: The Basic Forecasting report for beer sales.
Chapter 4
FIGURE 4-1: A sample SAS program, loaded and ready to run.
FIGURE 4-2: The various results created by running a SAS program.
FIGURE 4-3. Hunt your DATA step bugs with the DATA step debugger.
FIGURE 4-4: Results tallied by group.
FIGURE 4-5: Two lines of code produce so much information!
FIGURE 4-6: A beautiful result from a beautiful SAS program.
Chapter 5
FIGURE 5-1: Start importing data here.
FIGURE 5-2: The opening page of the Import Data Wizard.
FIGURE 5-3: Start tweaking import instructions here.
FIGURE 5-4: Tweak more import instructions here.
FIGURE 5-5: The data imported from Microsoft Excel, now in SAS.
FIGURE 5-6: An Excel file with data that doesn’t begin in A1.
FIGURE 5-7: The PROC IMPORT view of the transactions data.
FIGURE 5-8: DATA step output with the data fields in perfect order.
FIGURE 5-9: Choose a library.
FIGURE 5-10: The Tasks list with just the Library tasks visible.
FIGURE 5-11: The Assign Project Library Wizard walks you through the steps of a...
FIGURE 5-12: Enter the path where your data is located.
FIGURE 5-13: The Finish page with a Test Library button.
FIGURE 5-14: The updated Process Flow for the project, with added dependencies.
FIGURE 5-15: A SAS library view of a single JSON file represented as multiple d...
Chapter 6
FIGURE 6-1: Two data tables that illustrate the results of using the four join ...
FIGURE 6-2: An inner join.
FIGURE 6-3: A left join.
FIGURE 6-4: A right join.
FIGURE 6-5: A full outer join.
FIGURE 6-6: The Query Builder dialog box.
FIGURE 6-7: The Tables and Joins dialog box.
FIGURE 6-8: The Tables and Joins dialog box with the tables joined.
FIGURE 6-9: The Join Properties dialog box.
FIGURE 6-10: The main query dialog box, now listing the three tables.
FIGURE 6-11: You can use the Advanced Expression Builder to create computed col...
FIGURE 6-12: The completed Modify Additional Options page, with a useful alias ...
FIGURE 6-13: The Query Builder output table.
FIGURE 6-14: The Add New Prompt dialog box.
FIGURE 6-15: The Get Values dialog box with the updated values.
FIGURE 6-16: The Prompts dialog box asks you which product to use.
FIGURE 6-17: The list of tasks that match the Bar Chart Wizard keywords.
FIGURE 6-18: The bar chart with the results of your query analysis.
FIGURE 6-19: The Random Sample task with new selections in place.
FIGURE 6-20: The summarized table output from the query task.
FIGURE 6-21: Sales summary transposed by year.
FIGURE 6-22: Sales summary, ranked by year across the products.
FIGURE 6-23: Product sales ranking by year report.
Chapter 7
FIGURE 7-1: Change the file output type for a listing report.
FIGURE 7-2: Text output offers a small file size but poor layout and no formatt...
FIGURE 7-3: View reports in versatile, graphics-rich PDF format.
FIGURE 7-4: View your data in RTF format.
FIGURE 7-5: An HTML report created and viewed in SAS Studio.
FIGURE 7-6: All the options just for Excel output in SAS Enterprise Guide.
FIGURE 7-7: A simple spreadsheet created using
ods excel
.
FIGURE 7-8: A PowerPoint slide deck created completely from SAS code.
FIGURE 7-9: A sales report created with the List Data task.
FIGURE 7-10: The sales report produced with the List Data task.
FIGURE 7-11: The revised sales report after increasing the formatted width of S...
FIGURE 7-12: A box and whisker plot from the Summary Statistics task shows sale...
FIGURE 7-13: A summary table analyzing sales by region, category, and subcatego...
FIGURE 7-14: The Select Analysis Variables and Statistics screen.
FIGURE 7-15: The Select Classification Variables screen of the Summary Tables W...
Chapter 8
FIGURE 8-1: Bar chart of sales by region.
FIGURE 8-2: Bar chart of sales by region, grouped by fiscal quarter.
FIGURE 8-3: A silly pie chart, but a shining example of readability.
FIGURE 8-4: Line plots showing monthly sales by region over several years.
FIGURE 8-5: A log-adjusted line plot to eliminate the scaling effect.
FIGURE 8-6: A scatterplot with the regression line showing the relationship bet...
FIGURE 8-7: Bubble plots are useful for showing two variables for grouped data.
FIGURE 8-8: A heat map shows the “hot” months for sales across the years.
FIGURE 8-9: Box plots help you quickly understand the distribution of one varia...
FIGURE 8-10: Map graphs are a helpful way to present geographic data directly o...
FIGURE 8-11: An adverse event timeline plot, such as you might find in a clinic...
FIGURE 8-12: A Sankey diagram that illustrates a flow of web traffic.
FIGURE 8-13: Box plot of sales by subcategory.
FIGURE 8-14: Data prepped for your line plot analysis of sales.
FIGURE 8-15: Sales analysis by region.
FIGURE 8-16: Average sales by region for 2003.
Chapter 9
FIGURE 9-1: Lognormal curve, overlaid on the sales amount to examine whether th...
FIGURE 9-2: A two-way contingency table of gender by chocolate type preference.
FIGURE 9-3: A correlation table for corn yield versus the season measurements o...
FIGURE 9-4: A scatterplot showing the relationship between corn yield and mean ...
FIGURE 9-5: A one-way ANOVA examining the relationship of car type with price.
FIGURE 9-6: A prediction plot from the Linear Regression task showing the relat...
FIGURE 9-7: Automatically generated statistical diagnostics for the regression ...
FIGURE 9-8: A survival plot shows the survival rates of various groups.
FIGURE 9-9: A cluster analysis of Fisher’s iris data.
FIGURE 9-10: A simple forecast based on historical data with seasonality.
Chapter 10
FIGURE 10-1: A SAS model card for a sample gradient-boosting model related to s...
FIGURE 10-2: The output of PROC PARTITION to prepare data for training a model.
FIGURE 10-3: SAS Model Studio has a large list of supervised learning algorithm...
Chapter 11
FIGURE 11-1: It’s temporary data, but that doesn’t mean it’s unreliable.
FIGURE 11-2: When it comes to SAS data, sharing is caring. Get started with the...
FIGURE 11-3: A
where
expression, applied to the active Data view in SAS Enterpr...
FIGURE 11-4: The first page of the Export Step Wizard. Select what to export!
FIGURE 11-5: A Process Flow with an Export task to create an Excel file.
FIGURE 11-6: A Microsoft Excel workbook created using a program with LIBNAME XS...
FIGURE 11-7: A PDF file that is a product of the ODS sandwich.
FIGURE 11-8: A more concise PDF file, thanks to ODS options.
FIGURE 11-9: A gridded layout made using
ods layout
.
FIGURE 11-10: The SAS Job Execution Web Application in SAS Viya.
Chapter 12
FIGURE 12-1: Welcome to the Analytics Life Cycle in SAS Viya.
FIGURE 12-2: SAS Information Catalog provides a high-level view of everything i...
FIGURE 12-3: The Import window in SAS Data Explorer.
FIGURE 12-4: SAS Data Explorer has basic and advanced options for File Import.
FIGURE 12-5. A basic exploration of some of the Titanic data set.
FIGURE 12-6: A data profile for sample
Titanic
passenger data in SAS Informatio...
FIGURE 12-7: The New Project window for SAS Model Studio.
FIGURE 12-8: The model pipeline for the Titanic Survival project.
FIGURE 12-9: Model Comparison results showing the model performance statistics ...
FIGURE 12-10: The Model Results summary includes an assessment of model fairnes...
FIGURE 12-11: The model card for the
Titanic
model in SAS Model Manager.
FIGURE 12-12: Example of a model performance dashboard in SAS Model Manager.
Chapter 13
FIGURE 13-1: The SAS menu, as viewed in Microsoft Excel.
FIGURE 13-2: The Data Options window provides control over every aspect of how ...
FIGURE 13-3: An example of a full SAS data table added to a new Excel sheet.
FIGURE 13-4: The Candy Report content in the SAS pane, ready to add to Excel.
FIGURE 13-5: A report object from SAS Visual Analytics, now added to the spread...
FIGURE 13-6: The Upload Data options provide full control over how much data yo...
FIGURE 13-7: Use the Save As window to select the perfect spot for your data.
FIGURE 13-8: Options for managing SAS programs in your document.
Chapter 14
FIGURE 14-1: Candy Summary data on display in SAS Visual Analytics.
FIGURE 14-2: Exploring the existing reports in SAS Visual Analytics.
FIGURE 14-3: An empty report with the data selected and ready for you to use.
FIGURE 14-4: The SAS Visual Analytics user interface — more than meets the eye.
FIGURE 14-5: Outline view of the Candy Sales Summary report.
FIGURE 14-6: A linked selection between two report objects to see how they rela...
FIGURE 14-7: Export data from any data visualization object in SAS Visual Analy...
Chapter 15
FIGURE 15-1: Think globally but act locally!
FIGURE 15-2: Configure your metadata to get on the correct path.
FIGURE 15-3: The SAS Environment Manager window in SAS Viya.
FIGURE 15-4: Using SAS Data Explorer to define a new data source in SAS Viya.
Chapter 16
FIGURE 16-1: SAS Studio within SAS OnDemand for Academics, showing a t-test pro...
FIGURE 16-2: SAS Viya for Learners with a sample program and result.
FIGURE 16-3: SAS Viya Workbench for Learners, with an example from the SAS Stat...
Chapter 17
FIGURE 17-1: An easy-to-read Process Flow.
FIGURE 17-2: The missing link, found!
FIGURE 17-3: Order SAS around with ordered lists.
FIGURE 17-4: A simple flow in SAS Studio with three swimlanes to control the ru...
FIGURE 17-5: Bend the SAS tasks to your will with custom code.
Chapter 18
FIGURE 18-1: A snippet ready for you to press TAB and insert automatic text.
FIGURE 18-2: A SAS program gets a formatting makeover with the Format Code feat...
Cover
Table of Contents
Title Page
Copyright
Begin Reading
Index
About the Author
iii
iv
1
2
3
4
5
6
7
8
9
10
11
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
231
232
233
234
235
236
237
238
239
240
241
242
243
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
359
360
361
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
383
384
385
386
SAS For Dummies®, 3rd Edition
Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com
Copyright © 2025 by John Wiley & Sons, Inc. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.
Media and software compilation copyright © 2025 by John Wiley & Sons, Inc. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.
Published simultaneously in Canada.
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, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. SAS is a trademark or registered trademark of SAS Institute, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit https://hub.wiley.com/community/support/dummies.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2025934287
ISBN 978-1-394-31739-4 (pbk); ISBN 978-1-394-31741-7 (ebk); ISBN 978-1-394-31740-0 (ebk)
Unless you’re a hermit, chances are good that your life is touched by SAS (pronounced “sass”) almost every day.
Have you ever received an offer for a credit card in the mail? The bank might have used SAS to select you for the particular offer you received. Remember a recent news article that cited demographic trends in the United States? The Census Bureau uses SAS to crunch its numbers. Were you tempted to buy that new gadget in a big-name retail store or online? The corporate office might have used SAS to calculate the best price to set for that specific item on that specific week.
The rate you pay for life insurance, the analysis behind pharmaceutical drug trials, the quality of parts used to assemble your automobile — all these are determined by people who use SAS. You don’t see SAS directly from day to day — but, like gravity, it’s an invisible force that affects your life.
This book offers a prolonged glimpse into the multifaceted world of SAS software. Read on to discover how people use SAS to influence the world around you. Perhaps you’ll see how to grab the reins yourself and use SAS to affect your own sphere of influence.
Although this book is titled SAS For Dummies, 3rd Edition, you absolutely need some smarts to produce solid results using SAS. However, the overarching message of this book is that you don’t need to be an expert at using software. You just need to know what questions to ask, what data is needed to provide an answer, and how to interpret the results.
This book covers a variety of SAS products. I help you take a high-level look at some and then dive deeply into those that you’re most likely to use. The amazing fact is that SAS offers hundreds of software products covering dozens of industries and disciplines. No lone person could possibly use them all and still have time for essential activities, such as sleep and personal hygiene. (Hmm, maybe that explains the smell around here.)
Like most software products, SAS products look and work differently from version to version. This book describes the modern platforms of SAS 9.4 and SAS Viya, and their many different applications. Many of these interfaces are actively developed by SAS and will change and receive new features over time. As a result, some of the instructions and figures in the book will differ from what you see in your installation.
And, hey! Here’s something cool about this book: You don’t have to read it from stem to stern. Feel free to skip around, reading the sections that cover what you need to know.
This book does not dive deep into two popular SAS topics:
How to program in SAS:
SAS software has been around for almost 50 years, and you can find plenty of books about SAS programming. Indeed, one goal of this book is to show you how much you can do with SAS without having to become a SAS programmer. However, you’ll find several examples of SAS programs throughout the book, especially in
Chapter 4
, so you can at least recognize a SAS program if you meet one on the street.
Life at SAS Institute Inc., the makers of SAS software:
SAS, the company, has had more than its 15 minutes of fame on TV shows (such as “60 Minutes” and “Oprah”), plus a big dose of coverage in business magazines (such as
Fortune
and
Forbes
). The stories are overwhelmingly positive (not featuring anyone trying to blot out the camera view with their palm). SAS is famous for being a great place to work. (As an author, I do hold a day job at SAS — and I enjoy that job. That’s all I’ll say about that.)
This book contains lots of descriptive information about SAS software. Because a picture is worth — well, you know — this book has lots of figures of the software in action. (Action is a relative term; after all, this is business and analytical software, not Super Smash Bros.)
You’ll find plenty of step-by-step instructions to accomplish specific tasks. You can follow along with these if you have the software handy; otherwise, you can use your imagination and imagine how much fun it is.
When I show a filename, path, data set, or code within regular text, I set it off in a monofont type,
like this
.
When I want you to type something, I put the characters you type (such as
type this,
in bold).
If you get the munchies while reading this book, it's because most of the examples refer to data with a candy theme.
Occasionally, you’ll see some sidebar topics or Technical Stuff icons in the margin that indicate a historical or technical side point. You can skip those if you want, but reading them will give you that extra edge when SAS comes up in the discussion at the next cocktail party you attend. Study up and impress your friends!
To better manage the task of writing this book, I had to begin with some assumptions about you, the reader. Here they are:
SAS software runs on many types of computer systems, but the majority of people experience it under Microsoft Windows or within a web browser. So, the examples are presented as though you’re using a PC. I assume that you know your way around a PC, clicking the mouse, selecting menus, and so on.
As I stated, I don’t assume that you’re a SAS programmer or that you even aspire to be one. However, if you are or if you do, you’ll still find this book useful to round off your SAS knowledge.
All the information in this book is special; I wouldn’t have included it otherwise. But some information that I provide is more special than the rest. To draw attention to its specialness, I tagged it with some eye-catching little icons.
The Tip icon calls out a sentence or two that might prove to be a time-saver in your work. (You’re welcome.)
Got a mind like a steel sieve? Well, you might want to reserve some space in your memory bank for the content next to the Remember icon. I use this icon as a way to emphasize an important point or concept.
Hear the voice in your head yelling “Danger, Will Robinson! Danger!”? Is your Spidey-sense tingling? Well, there’s little danger, really, as long as you heed the advice shown near the Warning icon.
This book contains many little gems of technical information. You can still use SAS if you don’t read and understand this stuff, just like you can still enjoy watching hockey if you don’t know what icing means. But, as any fan will tell you, it’s more fun knowing what it all means.
After you complete this book, you might crave more details about specific areas that I cover. (Or maybe those cravings are related to the candy-themed examples.) The best starting place for more information is the SAS support website at https://support.sas.com.
If you want to try some of the exercises in the book on your own, I’ve assembled all the sample data, SAS programs, and projects in an online GitHub repository. You can find all of these at https://github.com/cjdinger/sasfordummies.
If this book transforms you into a card-carrying SAS user, your next step might be to seek out others like you. That will be easy because millions of people around the globe use SAS. And do you know what? Every day, they gather virtually in the SAS Support Communities, an online Q&A discussion site for sharing SAS experience and knowledge. Check it out at https://communities.sas.com.
Finally, in line with all the other books in the For Dummies series, I also provide a SAS online Cheat Sheet, which has additional tips for SAS programmers and the most essential techniques to learn in SAS code. To see the Cheat Sheet, simply go to www.dummies.com and type SAS For Dummies in the search box.
Part 1
IN THIS PART …
Learn about SAS and its long history as a statistical software package.
See the various applications that make up SAS and how people use them.
Take a whirlwind tour of SAS Enterprise Guide and learn to create results quickly.
Dive into SAS programming with a crash course on programming concepts and syntax.
Chapter 1
IN THIS CHAPTER
Finding something for everyone in SAS
Learning what SAS is
Discovering the many uses for SAS
Programming using SAS, or not
Examining a few real-world examples
One of the questions newcomers ask most frequently about SAS is, “What does the name mean?” After all, those capital letters usually indicate an acronym, right? Today, SAS just refers to the name of a company. If you’ve been around the world of data analysis for a while, however, you may also be familiar with the old meaning of SAS: Statistical Analysis System.
SAS software was developed by a bunch of smart and inquisitive people at North Carolina State University (NCSU) in the late 1960s and early 1970s. Some of these people are still at the company as owners or executives: Jim Goodnight (the current company president) and John Sall. Most of these SAS software pioneers were trained as statisticians or mathematicians and developed the SAS language to help analyze a variety of scientific experiments being conducted at NCSU and other research universities.
Over time, the software became as important as the experiments it was being used to analyze. The company now known as SAS Institute was formed in 1976, by a few people who were brave enough to leave the cozy world of academics for the then-unknown world of software. The first few years were a bit rough, but before long, word of this software and its capabilities began to spread, revenues increased, and the company began to grow. As of this writing, SAS has enjoyed nearly 50 consecutive years of growth and profitability. They must be doing something right.
This chapter is an overview of the power and flexibility of SAS for a range of applications and industries. SAS has expanded from being just a programming language for experts to meeting the needs of a wide variety of users in almost every industry and country in the world.
SAS is the iconic software that provides capabilities for data management, analytics, reporting, decisioning, and machine learning and AI.
What SAS looks like to you depends on your skills and interests, your job role, and what SAS products or solutions your organization has provided. As you can learn in Chapter 2, SAS comes in many shapes and sizes. Figure 1-1 shows an example of a SAS program and output in SAS Enterprise Guide, where Figure 1-2 shows a report designed within SAS Visual Analytics. These are just two of the many “faces of SAS” that SAS users may encounter.
FIGURE 1-1: One view of SAS: A program, log, and results shown in SAS Enterprise Guide.
FIGURE 1-2: Also SAS! A designed report in SAS Visual Analytics.
SAS 9.4 was released in 2013 as the latest major version of what users think of as the “classic” SAS platform. Even though its initial release was over a decade ago, SAS continues to enhance it and issue fixes by delivering maintenance releases, which allows SAS customers to continue using SAS 9.4 with the latest operating systems and security-conscious IT policies.
SAS Viya represents the newest capabilities of SAS, including the latest machine learning algorithms and AI methods. Every month, SAS delivers new SAS Viya releases, with fixes and new features. This continuous-delivery model is a standard practice for cloud-based software and software-as-a-service.
Even though SAS 9.4 and SAS Viya seem very different on the surface, they share a core that makes it easy to move from one to the other. In fact, many customers have both: a continuing SAS 9.4 installation while they accomplish new tasks using SAS Viya. The ability of SAS 9.4 to connect to SAS Viya helps these customers share data and code between the two systems.
You might assume that you need to be a statistician or math guru to use SAS, but happily that’s not the case. In the past several years, SAS has made a significant investment in making the unparalleled analytical and data management capabilities developed over 40-plus years available to almost anyone with a problem to solve in business, science, or government. With products such as SAS Enterprise Guide, SAS Visual Analytics, and SAS for Microsoft 365, SAS has never been more accessible or flexible. These products provide user-friendly interfaces to maximize the heavy-duty capabilities that SAS has long provided to gurus!
Most of this book is dedicated to spelling out simple-to-understand principles that are full of possibilities and limited only by your situation and imagination. SAS offers so much potential that this book just scratches the surface and gets you up to speed on the basics.
SAS is famous for its ability to access any type of data, regardless of the source. Of course, you can use SAS to connect with any database system to read and update data. SAS users also often work with file-based data such as flat files, Excel files, and long-forgotten formats such as fixed-length records and more. Finally, SAS includes methods to work with application programming interfaces (APIs) to pull and publish data in our Internet-connected world.
Data managers use all these aspects together with SAS procedures and interfaces to build robust, repeatable processes that can pull data in, transform and enrich it with analytical insights, and publish new data and results to the systems that need it. Conventional wisdom holds that 80 percent of analytics lies in the data prep — and SAS has that covered, and more.
SAS has been a leader in statistics since its inception — it’s literally part of the original meaning of the SAS name (as in Statistical Analysis Software). SAS software is used in universities around the world to teach statistical concepts. (See Chapter 16 for free and easy ways to learn SAS.)
In industry, SAS is used for all types of important statistical applications, including pharmaceutical research, medical studies, quality control, risk management, fraud detection, and many more. SAS software is often cited in published papers found in peer-reviewed scientific journals, where authors must share their methodology along with their findings and conclusions.
Chapter 9 provides an overview of the many statistical methods that SAS supports. Reading this book won’t make you a statistician, but you will learn enough to distinguish a p-value from a pie chart.
Regardless of industry, it’s the job of business analysts to help their organization make data-driven decisions. You’ve already read how SAS offers great coverage for managing data and crunching statistics. A business analyst needs the tools to build upon this work to create compelling data stories and communicate the insights to a less-technical audience. To that end, they need tools for
Reporting and visualization:
Needed to create detailed reports and visualizations to present findings in a clear and understandable way. This helps stakeholders grasp insights quickly and make strategic decisions.
Problem solving:
To identify business problems and use data to find solutions and examine what-if scenarios. This involves a lot of critical thinking and the ability to interpret data in the context of the business environment. Skilled analysts can explore solutions by using SAS code or by using interactive tools like SAS Visual Analytics (discussed in
Chapter 14
).
Communication:
To share their findings effectively to both technical and nontechnical audiences. This requires strong presentation skills and the ability to translate complex data into insights you can act on. The collaboration features of SAS for Microsoft 365 (see
Chapter 13
) and SAS Visual Analytics (see
Chapter 14
) reduce the barriers for sharing information with nontechnical audiences.
What happens when you cross the mathematical rigor of statistics with the process innovation of computer science? You get the newer discipline of data science, which has driven the adoption of machine learning and AI. Data scientists appreciate the tools that SAS offers for their discipline, which includes
Model building:
To develop and train statistical and machine learning models to make predictions or uncover insights. SAS provides robust tools for building and validating these models.
Chapter 10
covers the machine learning capabilities of SAS Viya.
Experimentation:
To design and conduct experiments to test hypotheses and validate models. This iterative process helps in refining models and improving their accuracy. Data scientists move easily through the analytics life cycle, as described in
Chapter 12
.
Algorithm Development:
To create and refine algorithms to solve specific business problems. This requires a deep understanding of both the data and the business context.
Collaboration:
To work closely with other teams and gain value from work done in the open-source community. To that end, they’re familiar with GitHub and programming tools that offer Git integration.
Data scientists are also more likely to be programming polyglots, proficient with multiple programming languages such as Python or R, along with SAS. SAS Viya and SAS Viya Workbench offer ways for them to use all their programming language skills to get the best results.
It used to be that you could access the capabilities of SAS only if you knew how to write programs (or if you were willing to learn). SAS has an incredibly powerful programming language, and if you know how to use it, there’s almost nothing you can’t accomplish (in the realm of data, statistics, and AI, that is). This book covers SAS programming in Chapter 4 and includes little drops of code examples throughout the rest of the chapters.
But if you’re not interested in writing and running your own SAS code, that won’t stop you from succeeding with SAS. So many of the SAS capabilities are available in easy-to-use applications that do not require or expect programming skills. For example, you can
Build
ad hoc
analyses and repeatable Process Flows with SAS Enterprise Guide, covered in
Chapter 2
and
Chapter 3
.
Manage and transform your data using an intuitive Query Builder interface, covered in
Chapter 5
.
Develop analytical models using machine learning with SAS Model Studio, as shown in
Chapter 10
.
Make the most of SAS data and reports in Microsoft 365 apps, like Excel and PowerPoint, using SAS for Microsoft 365. Check out
Chapter 13
to learn more about that.
Create amazing reports using SAS Visual Analytics, covered in
Chapter 14
.
As a long-time SAS user and employee of SAS, I have visited hundreds of customers and seen many real-world SAS success stories. From forecasting and data management to machine learning and beautiful reports, SAS can meet just about any need you can imagine. To read a wide array of detailed SAS case studies, use your favorite web browser and visit www.sas.com/success.
Chapter 2
IN THIS CHAPTER
Exploring the most common SAS interfaces: SAS Enterprise Guide and SAS Studio
Practicing with SAS tasks and a bit of code
Understanding how your SAS setup affects the way you work
In the early days of computing, SAS was the exclusive province of the geekiest statisticians and programmers. You could analyze data with SAS only if you knew how to prepare a set of punch cards with your program instructions. But today SAS offers a wide range of interfaces, from friendly point-and-click to code-centered workspaces.
In this chapter, you can learn about the many ways you can access SAS. Whether you're working on a desktop PC, in the cloud, or on a mobile device, SAS has an interface for you. You might even use multiple interfaces, depending on your tasks and your circumstance.
Looking at the wide array of capabilities that SAS Enterprise Guide encompasses, we can confidently call it the Swiss army knife of SAS. Just like a Swiss army knife, SAS Enterprise Guide is handy in lots of situations and offers a surprising array of options in a simple-to-learn package.
SAS Enterprise Guide is a ubiquitous SAS interface that almost every SAS customer has access to, in one way or another. It’s included with SAS for Microsoft Windows (sometimes called “PC SAS”), which is a local copy of SAS for your PC that works like your own personal SAS server. Universities teaching statistics courses and independent professionals learning SAS use SAS Enterprise Guide to access SAS OnDemand over the Internet, where SAS (the company) hosts the SAS server. Many companies also license SAS Enterprise Guide to allow their users to work with remote Windows, Unix, or mainframe SAS servers that they configure and maintain. Whichever configuration of SAS you use with SAS Enterprise Guide, most of the functionality is the same; the difference is whether the processing is performed on your PC or on a remote computer.
This book addresses SAS Enterprise Guide 8.4 or later, which works with SAS 9.4 and SAS Viya.
When you first install and use SAS Enterprise Guide, the interface looks like Figure 2-1. This is the default, out-of-the-box view.
FIGURE 2-1: The welcoming SAS Enterprise Guide start screen.
The interface contains familiar elements, such as a top-level menu and a toolbar. Don't let this simple façade fool you, though. Beneath the menus and widget panes are hundreds of tasks and functions that await your command.
SAS Enterprise Guide supports two ways of working: using a project workspace or bypassing the project work mode.
Using a SAS Enterprise Guide project. A project is handy for organizing your work. A project may contain SAS programs, data shortcuts, tasks such as analytical steps or query steps, and one or more Process Flow diagrams that help you keep everything straight.
Use a project when you want to build a repeatable series of steps that you might need in the future, whether that's tomorrow or next month or next year.
Some SAS Enterprise Guide features require a project, such as interactive tasks or query steps. A project file is saved as a document with a file extension of .egp (Enterprise Guide Project — get it?). It's easy to open the project again later to pick up where you left off.
Skipping the project.
Sometimes you want to simply open and view data, or open or create a SAS program to run. For these simple operations, a project file isn't required. If you don’t need tasks or flows, you can jump in and out of SAS Enterprise Guide without the overhead of a project file.
If you plan to spend any appreciable amount of time in SAS Enterprise Guide, you should spend a few moments to customize the workspace according to your preferences.
For many users, the first thing they want to enable is dark mode. Like most productivity applications these days, SAS Enterprise Guide includes a dark theme that you might find is easier on your eyes.
To set the appearance theme for SAS Enterprise Guide, follow these steps:
Choose Tools ⇒ Options from the main menu.
The Options window offers hundreds of preferences that you can set. It's worth exploring all of these later, but for now you're on the hunt for one specific setting.
Choose the General category.
Under the Visual Experience heading, you’ll see a single selection for Color Theme. The default theme is Illuminate (Light).
Choose Ignite (Dark) from the drop-down list and then click OK.
The effect is immediate, and the SAS Enterprise Guide window transforms to a deep midnight blue.
Use Ctrl+F2 as a keyboard shortcut to toggle between the Ignite (dark) and Illuminate (light) themes.
You can arrange the SAS Enterprise Guide windows in an infinite array of combinations. The easiest way to see this in action is to run a SAS program that creates a variety of outputs — this creates plenty of windows and tabs to play with. (Don't worry if you aren't an experienced programmer; Chapter 4 introduces you to the basics of SAS programming.) The next steps include everything you need.
To create output with a sample SAS program:
Choose File ⇒ New ⇒ Program from the main menu.
An empty Program window appears, a blank canvas for your code creation.
In the Program window, type the following program statements:
ods graphics on;proc freq data=sashelp.cars; table origin / out=counts plots=freqplot;run;
This simple program tells SAS to generate frequency counts for one variable in a sample data set. It saves the Counts data to a new data set and creates a simple listing and plot for your review.
Click Run on the Program toolbar.
It may take a moment to connect to your SAS environment and process the code, but in less than a minute, you should see the results.
The Program window includes several tabs with the additional content. In addition to the original Code tab, you see tabs for Log, Results, and Output Data.
Click-and-drag the Log tab.
As you drag the cursor, the Log tab “tears away” from its docked position. A position indicator shows the potential docking options to place the Log tab and customize your view. Hover the cursor over the position indicator to preview how the window will be docked when you release it.
Drag the Log tab over the Code tab and use the position indicator to place the Log tab at the bottom, and then release. The Code tab splits horizontally to create a space for the Log tab.
You can also “float” a tab or window without docking it. This allows you to place your SAS Enterprise Guide windows anywhere on your desktop, and even arrange them across multiple displays. This is a true power-user maneuver!
Click-and-drag the Output Data tab.
Just as you did with the Log tab, use the position indicator to place the Output Data tab and dock it to the bottom region, this time below the Results tab. When you release the mouse button, you should have a window arrangement that looks like Figure 2-2.
Take a moment to admire your work. The next step is to practice resetting your custom view.
Choose View ⇒ Program Tab Presets ⇒ Standard.
The Program window layout snaps back to its original arrangement.
The Program Tab Presets menu offers several different window layouts that SAS users have found to work well for them. Feel free to try these on for size to see how you like them.
FIGURE 2-2: A quad-box arrangement of the essential SAS elements: code, log, results, and data.
Every window in SAS Enterprise Guide is movable, dockable, and floatable. This provides all the flexibility you need to arrange your workspace to fit your needs. As you play with the windows and tabs, you might find yourself stuck with a layout that feels hard to undo. When this happens, choose View ⇒ Reset Default Layout to return to the original start position.
After running a program in SAS Enterprise Guide and taking pride in your results, you have several choices for what to do next:
You can exit the application and discard your work.
You can save the program as a new program file, with a
.sas
file extension, so that you can call it up later in any SAS application.
You can save the program and its results in a new SAS Enterprise Guide project file. Project files allow you to keep multiple programs and tasks together, along with the results from the last time you ran them.
Each of these options is valid and useful. There are no wrong answers!
The following steps pick up with work from the previous section, where you have a SAS program that you ran and created some output. To save a new project file with an existing SAS program and results, do the following:
Choose File ⇒ New ⇒ Project.
A new project workspace is created. You see a few subtle changes in the SAS Enterprise Guide windows.
First, the main window title changes to have the word Project displayed. Project is the name of your project until you save it permanently with a different name.
Second, you see the structure of the project on the Project tab (docked in the upper left corner, by default). At this point, the project is empty.
Right-click on the Program tab and choose Add to Project.
The Project content changes to add a Programs folder, and this existing program is placed within that new folder. The Program icon also changes slightly to indicate it is now part of the project.
With the project active, any new programs or tasks that you create in this project workspace are automatically added to the project.
Choose File ⇒ Save “Project” Project As.
The Save window appears and allows you to see your file folders. The Save window provides access to multiple domains where you can save files, including the typical My Computer, SAS Servers, and SAS Folders. For now, let's keep things local to your computer.
Click the Browse button to navigate to a local folder location, such as your
Documents
folder, to save the project file.
Enter a name for the project, such as MyFirstSASProject.egp, and then click Save.
The main window title is now changed from the generic Project name to the new name you want.
Close SAS Enterprise Guide by choosing File ⇒ Exit.
After you have created and opened project files and SAS programs in SAS Enterprise Guide, you see that these are helpfully displayed in the list of Recent Items in the Start Page every time you launch the application. Click on the name of any recent file in the list to open it immediately. Convenient, right?
You can “pin” a file to keep frequently used programs and projects at the top of the Recent Items list, even as the list grows longer and less-recent items roll off it. Right-click on the file item in Recent Files and choose Pin to List from the menu that appears. You can also click the small Thumbtack icon that appears on the right side of the list next to the item you want to pin.
After you've become familiar with the SAS Enterprise Guide workspace, you're probably ready to take the tool for a real test-drive. A primary role of SAS Enterprise Guide is to give you access to (and control over) your business data. For example, you can open SAS data sources or import almost any type of commonly used data format for use in SAS Enterprise Guide. This section provides a brief glimpse into accessing and managing data with SAS Enterprise Guide.
SAS data sets are the building blocks of many reports and analyses in SAS.
A SAS data set is the standard data storage format for data created with SAS.
The helpful aspect of SAS data sets is that they're fast to open and analyze relative to other data storage methods, such as text files, comma-separated values (CSV) files, Excel spreadsheets, and even relational databases such as Oracle or SQL Server. The output data created by your activities in SAS applications like SAS Enterprise Guide are, by default, SAS data sets.
Follow these steps to open a SAS data set to use in analysis tasks:
Choose Start ⇒ SAS Enterprise Guide.
On the Start Page, click Create New Project.
A new tab appears with an empty canvas, marked with grid lines. This represents the Process Flow, where all steps are organized.
Choose File ⇒ Open, and then select Servers.