Little SAS Book Series

4月 072018
 

Recently I was honored to be interviewed by Mamadou Dakouo for his company DataSteps.  I was asked three questions:

  • How did I learn SAS?
  • What advice do I have for someone who wants to become a “top SAS programmer?”
  • What is my favorite SAS procedure?

My answers were

  • In graduate school
  • Be a self-starter
  • PROC FORMAT (runner-up: PROC SGPLOT)

For the details you can watch the video.

 

5月 122016
 

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

SAS Display Manager

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?

 


10月 232015
 

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.


10月 232015
 

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.


9月 092015
 

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


9月 092015
 

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


8月 222015
 

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.


8月 222015
 

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.