SAS® For Dummies®

 

by Stephen McDaniel and Chris Hemedinger

 

 

 

About the Authors

Stephen McDaniel works at Yahoo! in Sunnyvale, CA, and is the Senior Manager of User Empowerment–Business Intelligence and Analytics. He is a strategic advisor and mentor for the business units in Yahoo! Search Marketing, helping business users to harness the potential of their data assets for planning and decision-making. As a member of Strategic Data Systems, he works closely with the data warehousing, business intelligence, and analytic teams on behalf of the business units to provide user-centric vision and guidance to their efforts. You can reach him at www.stephenmcdaniel.us. Previously, Stephen was the senior manager in charge of the SAS Enterprise Guide and the SAS Add-In for Microsoft Office development teams at SAS. Stephen has been a SAS user for more than 17 years and has experience at over 50 companies as a statistician, statistical programmer, product manager, and manager of data warehousing and business intelligence.

Chris Hemedinger is a senior software manager in the Business Intelligence Clients division at SAS. Chris began his career at SAS in 1993 as a technical writer, creating such hits as SAS Companion for the OS/2 Environment (remember OS/2?) and SAS Companion for the Microsoft Windows Environment. In 1997, he became involved in a prototype project to make SAS easier to use for non-programmers, and that project evolved into the hugely popular SAS Enterprise Guide, a product that Chris has worked with ever since.

 

Dedications

Stephen McDaniel: I want to thank my wonderful wife Eileen for her love, patience, support, help, reviews, and encouragement throughout the writing process!

Chris Hemedinger: For my beautiful wife Gail: for her patience and for our three daughters (even though they would never tolerate my chapters as acceptable bedtime-story material, despite my coaxing).

 

Authors’ Acknowledgments

They said it couldn’t be done. They said that it wasn’t possible to cover a broad and complex topic like SAS in a For Dummies book.

“They” (whoever they are) obviously were not aware of the fantastic help that we had on this project, so it turns out that “they” were wrong.

We, the humble authors, could not have planned and completed this book without the tremendous help of our editors at Wiley and at SAS Press. From Wiley, we relied on Jodi Jensen, Katie Feltman, Teresa Artman, and James Russell. At SAS Press, Judy Whatley served as our acquisitions editor, traffic cop, and cheerleader.

We also had great technical and content feedback from our panel of reviewers: Marilyn Adams at SAS, Sarah Hayford at Duke, Eileen McDaniel at UNC-CH, Tonya Balan at SAS, David Bailey at SAS, Ted Meleky at SAS, and I-Kong Fu at SAS.

In the area of moral support, we thank Gail Kramer (our boss) and David Rieder (Stephen’s friend) for their encouragement. We would also like to thank all of the people who helped us in SAS R&D and the SAS Enterprise Excellence Center for providing the demo servers for some of these chapters. Demos used from the EEC were created by Ken Matz, Justin Choy, and Renato Luppi of SAS. Stephen would also like to thank Rick Styll and I-Kong Fu for their support throughout the process.

—Stephen and Chris

I also want to thank a few of the many friends I have made over the years in my career: David Vangeison, Huifang Wang, Rajiv Ramarajan, Brian Casto, Joe Carter, Brenda Wolfe, David Duling, Michael Leonard, and Pat Maher from SAS; Alan Churchill of Savian; Bala Ganesh and PJ Haselton from Loudcloud; John Rotherham, Ken Kane, and Dave Jesky from Brio; Lynn Polingo, Gene Lim, and Anthony Edmonds from TAP Pharmaceuticals; Jim Esinhart and Ferrell Drewry from PharmaResearch; Mike Wisniewski, Paul Jarrett, and John Jones from Glaxo; and Meimei Ma, Steve Wright, and Sid White from Quintiles. Thanks to all of you for helping me, encouraging me, and supporting me throughout the years!

Stephen McDaniel

 

Publisher’s Acknowledgments

We’re proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/.

Some of the people who helped bring this book to market include the following:

Acquisitions, Editorial, and Media Development

Project Editor: Jodi Jensen

Senior Acquisitions Editor: Katie Feltman

Development Editor: James Russell

Senior Copy Editor: Teresa Artman

Technical Editor: SAS, Inc.

Editorial Manager: Jodi Jensen

Media Development and Quality Assurance: Angela Denny, Kate Jenkins, Steven Kudirka, Kit Malone

Media Development Coordinator: Jenny Swisher

Media Project Supervisor: Laura Moss-Hollister

Editorial Assistant: Amanda Foxworth

Senior Editorial Assistant: Cherie Case

Cartoons: Rich Tennant (www.the5thwave.com)

Composition Services

Project Coordinator: Patrick Redmond

Layout and Graphics: Claudia Bell, Joyce Haughey, Barbara Moore, Heather Ryan

Proofreaders: Aptara

Indexer: Aptara

Anniversary Logo Design: Richard Pacifico

Publishing and Editorial for Technology Dummies

Richard Swadley, Vice President and Executive Group Publisher

Andy Cummings, Vice President and Publisher

Mary Bednarek, Executive Acquisitions Director

Mary C. Corder, Editorial Director

Publishing for Consumer Dummies

Diane Graves Steele, Vice President and Publisher

Joyce Pepple, Acquisitions Director

Composition Services

Gerry Fahey, Vice President of Production Services

Debbie Stailey, Director of Composition Services

Contents

Title

Introduction

About This Book

Foolish Assumptions

What Not to Read

Conventions Used in This Book

Icons Used in This Book

How This Book Is Organized

Where to Go from Here

Part I : Welcome to SAS!

Chapter 1: Touring the Wonderful World of SAS

SAS — Isn’t That Just for Gurus?

Data, Data Everywhere — But Not Where I Need It!

Data Summaries and Reporting

The Secret Sauce: Analytics to Optimize the Present and Predict the Future

Sharing the SAS Wealth

What the IT Department Needs to Know

Checking Out Real-World Success Stories

Chapter 2: Your Connection to SAS: Using SAS Enterprise Guide

Using SAS Enterprise Guide, the Swiss Army Knife of SAS

Accessing and Managing Data

Visualizing Success with Charts

Creating Reports for Even the Crankiest Manager

Chapter 3: Six-Minute Abs: Getting Miraculous Results with SAS

Where Is My Data Set Coming from and Where Is It Going?

Querying Your Way to Success

Summarizing the Data

Building a Forecast

Part II : Gathering Data and Presenting Information

Chapter 4: Accessing Data: Oh, the Choices!

Microsoft Excel, Microsoft Access, and Text Files: Accessing the Data Hidden on Your PC

Server-Based Data: Can You Super-Size That?

Chapter 5: Managing Data: I Can Do That?

Taking a Quick Look at What You Can Do with Data

Queries: Bringing Your Data Together and Making It Sing (Or at Least Hum)

Editing, Sorting, Ranking, Transposing, and Other Data Contortions

Chapter 6: Show Me a Report in Less Than a Minute

Discovering Your Reporting Options

Data Listings and Summaries for the Listless

Chapter 7: You Want Fries with That Graph?

Graphing Basics

Graphs for Every Occasion

Creating Graphs with SAS

Part III : Impressing Your Boss with Your SAS Business Intelligence

Chapter 8: A Painless Introduction to Analytics

Analytic Concepts Useful for Everyone

Distribution Analysis — Describing Your Data

Analyzing Counts and Frequencies

Transforming Your Data for Further Use

Basic Data Analysis via Correlation Techniques

ANOVA and Regression: No PhD Required!

Chapter 9: More Analytics to Enlighten and Entertain

Staying Alive with Survival Analysis

Quality Control: You Want Something That Works?

Multivariate Analysis: Understanding Complex Relationships

Forecasting: Using the Crystal Ball

Data Mining: Precious Jewels in Your Data

Chapter 10: Making It Pretty: Controlling Your Output

Output Delivery with No Extra Postage Required

Power of the Palette: Creating Your Own Styles

Mixing Style and Substance: Conveying Meaning with Style

Plain Text Is Not Dead Yet

Part IV : Enhancing and Sharing Your SAS Masterpieces

Chapter 11: Leveraging Work from SAS to Those Less Fortunate

Pulling Out Results without Pulling Teeth

Using Only the Good Bits: Assembling Reports in a Snap

Canning Your Work for Others to Use in Stored Processes

Chapter 12: OLAP: Impressing Your Co-workers

Who Invited All the Cubes?

OLAP Features

More OLAP Features

Chapter 13: Supercharge Microsoft Office with SAS

The Power of SAS from the Cozy World of Office

Using the Add-In to Get the Most Out of Office Integration

Chapter 14: Web Fever: Yeah, SAS Has That Covered

Self-Service Reporting for Everyone

Going beyond Basic Reporting

More Details on SAS Web Report Studio

Part V : Getting SAS Ready to Rock and Roll

Chapter 15: Setting It All Up

How Complicated? It Depends

The Sweetest Setup: Local-Local

Distributing SAS to the Masses

Good News Travels Fast — How about Your Data?

Chapter 16: Taming the Data Beast

Data Warehousing: Do I Really Need to Think about This?

Fundamental Principles of Data Warehousing

The Value of Well-Managed Data Marts

Chapter 17: The New World Meets the Old: Programmers and SAS Enterprise Guide

Getting Organized with Projects

Letting SAS Tasks Do the Heavy Lifting

Being Flexible with Project Parameters

Off-Limits: Stuff That Won’t Work

Part VI : The Part of Tens

Chapter 18: Ten SAS Enterprise Guide Productivity Tips

The “Keys” to Success

Don’t Limit Yourself: Use More than One Session

See What’s Installed on Your Server

The Switcheroo: Changing the Input Data for a Task

Watch the Log Grow

Copy Data

Expand Your Horizons with Custom Tasks

Submit a Selection

Don’t Wait for Data to Open

Need Not Be Present to Win: Schedule Your Project

Chapter 19: Ten Tips for Administrators

Determining When SASUSER Isn’t Usable

Managing Logins from SAS Enterprise Guide Explorer

Disarming SAS Enterprise Guide Explorer

Using METALIB to Synchronize Metadata with Reality

Getting Better Performance from Information Maps

Making Your Database Work for You with Implicit Pass-Through

Publishing Reports from SAS Enterprise Guide: What’s Needed

Catching and Killing a Runaway SAS Session

Telling One SAS.EXE from Another

Peering under the Covers with Process Logs

Chapter 20: Ten (or More) Web Resources for Extra Information

Need Some Support?

What Else Does SAS Offer and How Are Others Succeeding with SAS?

Help Me Out with More Info on Making Effective Charts and Graphs

Where Can I Find Out More about Business Intelligence?

Where Can I Discover More about Statistics and Analytics?

What about More Information That Just Did Not Fit in This Book?

: Further Reading

: Special Offer

Introduction

Unless you live as a hermit, chances are good that your life is touched by SAS 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? The corporate office might have used SAS to calculate the best price to set for that specific item in 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 of 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.

About This Book

Even though this book is titled SAS For Dummies, you absolutely need some smarts to get 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. We take a high-level look at some and 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 single 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.)

And, hey! Here’s something else 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 address two popular SAS topics:

bullet Learning the SAS programming language: SAS software has been around for more than 30 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 — unless you really want to.

bullet Life at SAS Institute Inc., the makers of SAS software: SAS, the company (along with its founder Jim Goodnight) 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 his palm). SAS is famous for being a great place to work. Because we, the authors, hold (or have held) day jobs at SAS — and we really like those jobs — that’s all we’ll say about that.

Foolish Assumptions

To better manage the task of writing this book, we had to begin with some assumptions about you, the reader. Here they are:

bullet SAS software runs on many different types of computer systems, but the majority of people experience it from Microsoft Windows. So, the examples provided are presented as if you’re using a PC. We assume that you know your way around a PC, clicking the mouse, selecting menus, and so on.

bullet As we stated earlier, we don’t assume that you are a SAS programmer or that you even aspire to be one. However, if you are or if you do, you can still find this book useful to round off your SAS knowledge.

What Not to Read

Occasionally, you’ll see some sidebar topics or Technical Stuff icons in the margin that indicate an historical or a technical side point. You can skip those if you want to, 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!

Conventions Used in This Book

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 World of Warcraft.)

bullet 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 pretend how much fun it is.

bullet When we show a URL, filename, path, data set, or code within regular text, we set it off in a monofont type, like this.

bullet When we want you to type something, we bold the characters you type (such as, type this).

bullet If you get the munchies while reading this book, it’s because most of the examples refer to data with a candy theme.

bullet The data files discussed in the book actually ship with SAS Enterprise Guide, which is a SAS application that features prominently in this book.

Icons Used in This Book

All the information in this book is special; we would not have included it otherwise. But some information that we provide is more special than the rest. To draw attention to its “specialness,” we tagged it with some eye-catching little icons:

Tip

The Tip icon calls out a sentence or two that might prove to be a real timesaver in your work. (You’re welcome.)

Remember

Got a mind like a steel sieve? Well, you might want to reserve some space in your memory banks for the content next to the Remember icon. We use these as a way to emphasize important points or concepts.

Warning(bomb)

Hear the voice in your head yelling “Danger Will Robinson! Danger!”? Well, there is little danger really, as long as you heed the advice shown near the Warning icon.

TechnicalStuff

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.

How This Book Is Organized

Yes, this book is organized; the chapters don’t simply appear in random order. There are six major parts, each of which includes some relatively self-contained chapters. Don’t feel like you need to read them in order though. Please, make yourself at home and read whichever chapters interest you the most. (Really, it’s okay; we won’t be offended.)

Part I: Welcome to SAS!

SAS, meet reader. Reader, meet SAS. In Part I, you get to know each other in this overview of what SAS software is about and what it can do for you. You’ll find an introduction to SAS Enterprise Guide and some examples for getting quick results without having to be an expert.

Part II: Gathering Data and Presenting Information

Data is everywhere, but information is scarce. Part II shows how you can use SAS to take data and turn it into information you can use. And even better, you can see how to turn it into information that others will use and thank you for. You’ll find out how to build basic reports and graphs that actually convey useful information.

Part III: Impressing Your Boss with Your SAS Business Intelligence

Part III is a whirlwind tour through the concepts of statistics and analytics. You get an overview of the basics, as well as some examples of how those are applied to help you understand and predict behavior, as represented in data. Correlations, causality, forecasting — those topics and others are discussed here.

Part IV: Enhancing and Sharing Your SAS Masterpieces

Part IV could be titled “SAS: It’s Everywhere You Want to Be” or “SAS: It’s Not Just for Programmers Anymore.” You’ll see how you can use SAS from your desktop, on the Web, in Microsoft Excel, and even in Microsoft PowerPoint!

Part V: Getting SAS Ready to Rock and Roll

Part V provides the high-level view of how to install and configure SAS software. You might come away with an enhanced appreciation for whomever performs that task for you. This part also covers the concept of data collection and preparation — the repeatable process for making data available for analysis. And for the SAS programmers in the audience, you can find a candid overview of SAS Enterprise Guide, your new friend.

Part VI: The Part of Tens

Part VI is where we stored the nuggets of knowledge that you can count on both hands (or feet!). Even if you already consider yourself a SAS expert (maybe your Mom gave you this book for Christmas), we promise that you will discover something new here. Check out Part VI for ten productivity tips for SAS Enterprise Guide users, ten “must-know” items for SAS administrators, and links to more resources.

Where to Go from Here

After you read through this book, you might crave more details about specific areas that we cover. (Or maybe those cravings are related to the candy-themed examples.) The best starting place for more information is the SAS support Web site at http://support.sas.com.

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 all around the globe use SAS. And do you know what? They like to get together every so often in SAS user groups. User group meetings and conferences provide a great way to learn more from your peers about how to use SAS in practical and creative ways. Again, user group information is available from SAS at http://support.sas.com.

Part I

Welcome to SAS!

In this part . . .

W hat exactly is SAS anyway? Is it really a Scandinavian airline (wrong “SAS”), or do those letters mean something else?

In this part, you discover how to see the world for what it is: a huge bucket of data. And we show you how you can use SAS software to pull some of that data together and draw useful information from it. We introduce you to some of the basic tools that will become your companions as you begin your journey toward SAS savvyness.