Susan Slaughter

Archive for the ‘Little SAS Book Series’ Category

What’s Your SAS Interface?

In Enterprise Guide, Everything, Little SAS Book Series, SAS on May 12, 2016 at 7:30 am

These days SAS programmers have more choices than ever before about how to run SAS.  They can use the old Display Manager interface, or SAS Enterprise Guide, or the new kid on the block: SAS StudioAll of these are included with Base SAS.

DisplayManager9-4window

Display Manager / SAS Windowing Environment

EG7-12window

SAS Enterprise Guide

SASStudio3-5window

SAS Studio

Once upon a time, the only choices were Display Manager (officially named the SAS windowing environment), or batch.  Then along came SAS Enterprise Guide.  (Ok, I know there were a few others, but I don’t count SAS/ASSIST which was rightly spurned by SAS users, or the Analyst application which was just a stopover on the highway to SAS Enterprise Guide.)

I recently asked a SAS user, “Which interface do you use for SAS programming?”

She replied, “Interface?  I just install SAS and use it.”

“You’re using Display Manager,” I explained, but she had no idea what I was talking about.

Trust me.  This person is an extremely sophisticated SAS user who does a lot of leading-edge mathematical programming, but she didn’t realize that Display Manager is not SAS.  It is just an interface to SAS.

This is where old timers like me have an advantage.  If you can remember running SAS in batch, then you know that Display Manager, SAS Enterprise Guide, and SAS Studio are just interfaces to SAS–wonderful, manna from heaven–but still just interfaces.  They are optional.  You could write SAS programs in Word or Notepad or some other editor, and submit them in batch–but why would you?  (I know someone is going to tell me that they do, in fact, do that, but the point is that it is not mainstream.  Only mega-nerds with the instincts of a true hacker do that these days.)

Each of these interfaces has advantages and disadvantages.  I’m not going to list them all here, because this is a blog not an encyclopedia, but the tweet would be

“DM is the simplest, EG has projects, SS runs in browsers.”

Personally, I think all of these interfaces are keepers.  At least for the near future, all three of these interfaces will continue to be used.  What we are seeing here is a proliferation of choices, not displacement of one with another.

So what’s your SAS interface?

 

A short history of The Little SAS Book

In Everything, Little SAS Book Series, Publishing, SAS on November 19, 2015 at 10:11 am

In celebration of SAS Press’ 25th anniversary, Lora Delwiche and I reminisced about what it was like writing the first edition of The Little SAS BookYou can read about it on The SAS Learning Post. LSB1_and_SAS_manual

Who was the first SAS user to write a SAS book?

In Everything, Little SAS Book Series, Publishing, SAS, Writing on November 12, 2015 at 9:59 am

First_SAS_Book_cover SAS Press has been publishing books written by SAS users for 25 years.  That made me wonder: Who wrote the first such book?  The answer depends on how you phrase the question.  You can read about it on the SAS Learning Post.

Save Big on SAS Books

In Everything, Little SAS Book Series, SAS on October 22, 2015 at 10:33 am

Have you been thinking about ordering a SAS book or two?  Now is the time to do it.  SAS Press is a quarter century old.  To celebrate, they are offering a 25% discount on books ordered by December 31, 2015.  To get the discount, use the promo code SMPBBP when you place your order at support.sas.com/publishing/ (only available in the US).

Since SAS Press always has FREE SHIPPING for books, this means you get a real bargain.  For example, if you were to order The Little SAS Book, Fifth Edition from Amazon.com, it would set you back $47.30.  But with the SAS Press 25% discount, the same book costs only $41.21.  Such a deal!

SASPress_25Anniv_1024x512-1My question is this: Will they offer a 50% discount in another quarter century?  We will just have to wait and see.

SAS Essentials

In Everything, Little SAS Book Series, SAS, Western Users of SAS Software on September 8, 2015 at 7:45 pm

WUSS2015logoThe SAS Essentials section at the Western Users of SAS Software conference was created for people who are new to SAS.  Each year this section includes three core presentations designed to give both a broad overview and, at the same time, a thorough grounding in the fundamentals of SAS. For years I have thought about teaching the SAS Essentials core classes.  Well, this year I finally took the plunge, so to speak.  I really did feel like I was diving into deep water.  It was overwhelming, but it was also fun!  I think I did a good job of covering the basics in a short space.  You can download my slides here:

How SAS Thinks: SAS Basics I

Introduction to DATA Step Programming: SAS Basics II

Introduction to SAS Procedures: SAS Basics III

Exercises for Learning SAS Programming

In Everything, Little SAS Book Series, SAS on August 21, 2015 at 10:36 am

LSBXcoverOur new book, Exercises and Projects for The Little SAS® Book Fifth Edition, includes a variety of exercises to help people learn SAS programming.  Rebecca Ottesen, Lora Delwiche and I designed this book so that it can be used either in a classroom setting or by individual readers working alone.

One of the challenges we faced in writing exercises was how to create questions that were thought-provoking and yet not too complicated for people who are just starting to learn SAS.  Our goal was not only to test readers’ knowledge, but to solidify that knowledge so they will remember what they learn.  That’s why we included different types of exercises.  Multiple-choice exercises are quick and easy, open-ended short answer exercises encourage readers to think a little more deeply about the material, and then programming exercises challenge readers to apply what they have learned.

The following questions are examples of the three types of exercises found in our book.  For help with these exercises, see section 4.13 “Producing Tabular Reports with PROC TABULATE” in The Little SAS® Book, Fifth Edition.

Multiple Choice

1.  For variables listed in a CLASS statement, what statistic will PROC TABULATE produce by default?

a. Sums
b. Percentages
c. Means
d. Counts

2.  If you specify two dimensions in a TABLE statement in PROC TABULATE, which dimensions will you get?

a. Pages and rows
b. Pages and columns
c. Rows and columns
d. Columns and rows

Short Answer

3.  Explain what happens to observations with missing values for variables listed in a CLASS statement in PROC TABULATE.  Describe an option you can use to change this default behavior.

4.  Is it possible to write a TABLE statement in PROC TABULATE that specifies a row dimension but no column dimension?  Explain your answer.

Programming Exercises

    5.  A friend, who has recently begun bird watching, keeps a list of birds.  For each species, she records its name and three one letter codes.  The codes indicate whether or not she has seen that species (S for seen, or N for not seen), the type of bird (G for game birds, S for songbirds, R for raptors, or W for waterfowl), and whether or not that species is migratory (M for migratory, or N for nonmigratory).  Use the data in her list to create summary reports.

a. Write a DATA step to read the following raw data into a SAS data set.

Bald Eagle     S R M
Barn Owl       S R M
Gambel’s Quail S G N
Canada Goose   S G N
Cardinal       N S N
Common Loon    N W M
Condor         N R N
Crow           S S N
Elf Owl        N R N
Golden Eagle   N R M
Goldfinch      S S M
Magpie         S S N
Mallard        S W M
Meadowlark     N S N
Mockingbird    S S N
Osprey         N R M
Robin          S S M
Scrub Jay      S S N
Rock Ptarmigan N G N
Turkey         N G N

b. Using PROC TABLULATE, produce a report with counts that specifies rows for the type of bird and columns for whether the bird has been seen.  Be sure to include an appropriate title.

c. Create user-defined formats to replace the one letter codes with formatted values for the type of bird and whether or not it has been seen.  Rerun the report using the new formats.

d. Use a different procedure to produce the same counts.  Then add a comment to your program describing the differences between the two reports.

We hope that you found this information helpful.  Visit the book page for additional information, reviews, and a free book excerpt.

Presenting the Newest Member of The Little SAS Book Family

In Everything, Little SAS Book Series, SAS on July 24, 2015 at 2:23 pm

LSBXcoverThere is a new kid on the block: Exercises and Projects for The Little SAS Book Fifth Edition.  Rebecca Ottesen, Lora Delwiche and I have worked for three years to complete this book of multiple choice, short answer, programming exercises, and projects.  This book is designed to be used as a supplement to the fifth edition of The Little SAS Book.  However, I think this book has turned out so well that someone who just wants practice with SAS programming could use this book by itself.

One of the great things about this book is that we have created 77 data sets for the programming exercises, and you can download these data sets for free.

For more information about our book or to download the data, click here.

Now Starring Susan and Lora in “SGPLOT and SGPANEL Procedures”

In Everything, Little SAS Book Series, ODS Graphics, SAS, SAS Global Forum on May 29, 2015 at 10:14 am

SAS Global Forum logoODS Graphics is not exactly new.  It became production with SAS 9.2 back around 2008, and before then it existed in a pre-production form at least as early as 2003.  So you would think that by now everyone who uses SAS would be using ODS Graphics, but apparently this is not the case.

It has come to my attention that some long-time SAS users still use PROC CHART–not even PROC GCHART, but PROC CHART which was designed for line printers back in the 1970s and creates graphs using alphanumeric characters!  Here is an example of a bar chart created using PROC CHART:

PROC_CHART

There is no excuse for this (unless, of course, you are trying to create a hip, retro vibe).  ODS Graphics is easy to use and produces beautiful graphs.  Here is the same bar chart created using PROC SGPLOT:

PROC_SGPLOT

Now, if you are one of those people who uses SAS/Graph and PROC GCHART, and you are able to get the results you want, then that’s great.  I would never tell a SAS/Graph user to switch to ODS Graphics.  But for most people SAS/Graph is just too hard to use.  That’s why the developers at SAS created ODS Graphics: for the rest of us.  Just to prove that PROC SGPLOT is not any harder than PROC CHART, here is the code I used to create the two preceding bar charts:

PROC CHART DATA = olympics;
VBAR Region / SUBGROUP = PopGroup;
RUN;

PROC SGPLOT DATA = olympics;
VBAR Region / GROUP = PopGroup;
RUN;

If you are one of those people who still hasn’t learned ODS Graphics (or if you are new to SAS and want to get off on the right foot), this is your big chance.  At the recent SAS Global Forum conference, Lora Delwiche and I presented our paper “Graphing Made Easy with SGPLOT and SGPANEL Procedures.”  You can view that presentation.  Give us 50 minutes of your time, and we will convince you that ODS Graphics is easy (and maybe even fun) to use.  We start with a general introduction so you understand how the SGPLOT and SGPANEL procedures fit into the larger world of ODS Graphics, then we show how to create different types of graphs and how to customize them.

To watch our presentation, click here.

To download a copy of our paper, click here.

A lot of other great presentations were recorded at SGF too.  To see the full list, click here.

Happy graphing!

 

NOWINDOWS Goes Out the Window

In Little SAS Book Series, SAS Global Forum, SAS, Everything on February 18, 2014 at 4:25 pm

I just discovered by accident a new “feature” in SAS 9.4, one that apparently wasn’t glamorous enough to be mentioned back at SAS Global Forum last spring.

Starting with SAS 9.4, by default, PROC REPORT runs in noninteractive mode.

In other words, you no longer have to specify the NOWINDOW option in order to avoid that clunky interactive REPORT window.  If you are one of the half dozen people who actually want that window, you can still open it by specifying the WINDOWS option on the PROC REPORT statement.  (Be sure you type that S because it’s WINDOWS not WINDOW.)  But since I have always detested the REPORT window, you won’t find me doing that.  So you would think I would be happy.  Instead, this change leaves me feeling conflicted and confused.

This is the kind of change that makes programmers cheer—and technical writers cringe! 

Why, oh why, couldn’t the good developers at SAS have defenestrated the REPORT window back with SAS 9.3 so that we could have incorporated this change into the newest edition of The Little SAS Book?  Arrrrg!  The Fifth Edition is only one year old and already obsolete—though fortunately only slightly so.

If you want more information, you can find this change documented in the What’s New in Base SAS 9.4 Procedures Guide.

2013 in review

In Detritus, Everything, Little SAS Book Series, SAS Global Forum on December 31, 2013 at 10:54 am

I am certainly not one to decline when someone offers to write a blog entry for me. Here, courtesy of the stats monkeys at WordPress is the annual report for the AvocetSolutions.com blog:

And here’s an excerpt:

A New York City subway train holds 1,200 people. This blog was viewed about 6,600 times in 2013. (Yes, that’s more than I expected too.) If it were a NYC subway train, it would take about 6 trips to carry that many people.

Click here to see the complete report.

To all my colleagues and friends

I send best wishes for a

Happy and Prosperous New Year!