SAS author's tip: debugging with the LIST option

This week's tip comes from SAS powerhouse Art Carpenter and his book Carpenter's Complete Guide to the SAS REPORT Procedure. SAS user Kim LeBouton called this book "the single best resource for PROC REPORT." And in his review, SAS user Charles Patridge said "This is a must-have book if you are a SAS user--period--no matter what level SAS user you are!" You can read more reviews here.

Most of you are probably very familiar with Art and his work. If you haven't consulted one of his books yet, you may have heard him speak at conferences or connected with him online. He's a busy guy! We're so happy that Art continues to publish with us.

To learn more about Art and his latest book  Carpenter’s Guide to Innovative SAS Techniques or to view a free chapter from any of his books, visit his author page.

The following excerpt is from SAS Press author Art Carpenter and his book "Carpenter's Complete Guide to the SAS REPORT Procedure" Copyright © 2007, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED. (please note that results may vary depending on your version of SAS software)

6.5.3 Debugging with the LIST Option

The LIST option can be used to expand the PROC REPORT step in the SAS log. The expansion includes the statements and options that have been left at defaults. The following simple PROC REPORT step has three variables on the COLUMN statement, but only two DEFINE statements. The output is directed only to the LISTING destination, and the programmer might want to know which options are being applied as defaults.

title1 'Using Proc REPORT';
title2 'Using the LIST Option';
proc report data=rptdata.clinics
<strong>list </strong>nowd;
column region ht wt;
define region / group;
define ht / analysis mean 'HEIGHT';
run;

Since the LIST option has been specified, the SAS log includes the following expanded PROC REPORT step code (the line breaks and code alignments are mine). The expanded code includes a DEFINE statement for WT.

 

 

 

Post a Comment

Three SAS books win international awards

This past January, I wrote, “As we wrapped up 2011 and began preparing for 2012," we were notified by the Society for Technical Communication, Carolina Chapter, that three SAS Press books received awards in the 2011-2012 competition. . . .

Entries receiving a Distinguished or Excellence award from the local STC chapter were eligible for submission to the STC International Summit Awards. Because all three of the SAS Press submissions in the 2011-2012 competition met these criteria, we submitted them to the international competition this past February. I am happy to report that we just received notice that in addition to the awards received at the local level, all three books also took awards at the international level.

  • Multiple Comparisons and Multiple Tests Using SAS®, Second Edition, which received an award of Distinguished in the STC Carolina Chapter competition, also received an award of Merit in this year’s STC International Summit Awards. Author Peter Westfall is a long-time SAS Press author; these are his first two STC awards. Author Randall Tobias is a long-time SAS Press author; these are his first two STC awards. Author Russell Wolfinger is a SAS employee; he now has five STC awards.
  • SAS® Functions by Example, Second Edition, which received an award of Distinguished in the STC Carolina Chapter competition, also received an award of Distinguished Technical Communication in this year’s STC International Summit Awards. Author Ron Cody is a long-time SAS Press author; he now has four STC awards.
  • Statistical Programming with SAS/IML® Software, which received an award of Excellence in the STC Carolina Chapter competition, also received an award of Excellence in this year’s STC International Summit Awards. Author Rick Wicklin is a SAS employee and first-time SAS Press author; this is his second STC award.

Once again, please join us in congratulating these authors for their well-deserved honors.

In case you are wondering, here’s a description of the award criteria:

An Award of Merit consistently meets high standards in most areas. The entry might contain a small number of major or minor flaws, but it still applies technical communication principles in a highly proficient manner.

An Award of Excellence consistently meets high standards in all areas. The entry might contain a single major flaw or a few minor flaws. The entry demonstrates an exceptional understanding of technical communication principles.

An Award of Distinguished Technical Communication is clearly superior in all areas. The entry contains no major flaws and few, if any, minor flaws. It applies the principles of technical communication in an outstanding way, particularly in the way that it anticipates and fulfills the needs of its audience.

Wondering about past winners?

Click here for a complete list of SAS Press books that have received STC awards.

Post a Comment

Help us improve your conference experience

SAS Publications participates in a number of conferences, from SAS events to solution and industry-focused conferences. We know our customers are looking to make the most of their conference experience, and we want to make your visit to the Exhibit Hall as helpful as possible. We want to know your likes and dislikes when it comes to visiting this area of a conference.

What’s your favorite part of a conference Exhibit Hall? Do you stroll through the booths every chance you get, looking for information and hoping to talk to experts? Do you go just for the pens, key chains, notepads and associated logoed items? Do you drop by just at break time for a refreshment? What makes you say “wow” when visiting an Exhibit Hall?

What do you dislike about Exhibit Halls? Do all booths look and act the same? Is it too crowded, too noisy? Do you not get the information you need?

If you’ve ever visited the SAS bookstore at a conference, you know we bring books for you to browse and purchase. What else could we do in the Exhibit Halls? Would you rather see us sponsor tracks or lead discussions about book topics? What will make your conference experience better?

We attend conferences for you, our customers. So help us make the experience a positive one. Leave a comment below and let us know what you’d like to see us do differently!

Post a Comment

SAS author's tip: the Student t-distribution

Remarkably, this week's tip was initially inspired by the Guinness Brewery in Dublin, Ireland. In his new book Statistical Analysis for Business Using JMP, Professor Willbann Terpening provides lots of useful information - including the origin and usage of the Student t-distribution.

If you'd like to get to know Willbann and his work better after reading the featured excerpt below, visit his author page. You'll find a free chapter from the book, JSL Scripts and instructions, and powerpoint slides. Cheers!

The following excerpt is from SAS Press author Willbann D. Terpening and his book "Statistical Analysis for Business Using JMP: A Student's Guide" Copyright © 2011, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED. (please note that results may vary depending on your version of SAS software)

The Student t-Distribution

The Student t-distribution, or more simply the t-distribution, arose in response to a common business application of quality control at the Guinness Brewery in Dublin, Ireland. The distribution was developed by William S. Gossett for his work with small samples at the brewery. Because the company regarded his work as proprietary, when he published his work in 1908, he used the pen name Student, hence the name Student t-distribution.

The t-distribution is very closely related to the standard normal distribution and, like the normal, is a symmetric bell-shaped distribution. Like the standard normal, it is centered at zero and can be positive or negative. The t-distribution, however, has a standard deviation that is generally larger than 1.0, the standard deviation of the standard normal distribution. The t-distribution has a single parameter, degrees of freedom (df). The degrees of freedom are directly related to the size of the sample. As the degrees of freedom increase, the t-distribution becomes more and more like the standard normal distribution.8 Figure 5.16 shows several t-distributions for various degrees of freedom along with the standard normal distribution for comparison. You can see that the t-distribution is “fatter” than the standard normal distribution (has a larger standard deviation) when the degrees of freedom are small (df = 1 or df = 5) but becomes more and more like the normal distribution as the degrees of freedom increase. For df = 20, the two curves are hard to distinguish.

Post a Comment

Going the wrong way down a one-way street

Have you ever turned the wrong way onto a one-way street? I was driving in downtown Raleigh last weekend and did just that. How embarrassing. Based on my driving directions, I knew there was a one-way street ahead. Truthfully, I was talking and laughing with my sister and wasn’t paying attention to my location relative to the order of my directions.

The syntax of a programming language is the set of rules that defines the combinations of symbols that are considered to be correctly structured programs in that language. When plotting driving directions you wouldn't consider taking a shortcut through somebody's backyard or going the wrong way down a one-way street.

Likewise an experienced programmer doesn't consider violating the basic syntax rules. Your syntax must not have errors such as

  • Missing or misspelled keywords
  • Invalid variable names
  • Missing or invalid punctuation
  • Invalid data options

If you want to learn more about SAS procedures, statements, system options, functions, and formats the new 9.3 Syntax Index from the Documentation site is now available to help you improve the performance of your SAS code.

Syntax is our mechanism for reading and writing SAS programs. Clearly, bad syntax can make programming tasks much more difficult and slow. I hope you’ll take the time to check out the 9.3 Syntax Index

SAS Publications continues to listen to your feedback and strives to provide the tools you need to take advantage of the Power of SAS!

Post a Comment

Finding each other through social media

Would you like to get to know others who share a common interest in SAS books and documentation? We’ve made it easy for you.

Besides reading this blog, here are 3 places to discuss our publications and get real-time announcements.

Or, if you’re a one-stop type, bookmark this page to stay current about updates to our groups.

While we don’t have an official presence on Pinterest  or Google+, if you're a fan of either I'd encourage you to explore these communities. For instance, you can “pin” some of your favorite SAS books on your Pinterest boards and search for SAS authors and users on Google+.

The growing number of social media options may seem overwhelming. However, as you explore our book-centric communities, I hope you’ll find a place that is just right for you.

Post a Comment

Making time to write

Michael Raithel even makes time to run the L.A. Marathon

Please don’t tell me that you do not have the time to write a book for SAS Press.  I already know that.  You have a lot of things to attend to:  a demanding job, family responsibilities, housework, yard work, shopping, cooking, eating, reading, favorite TV shows, commuting, sports to play, a pet to care for, exercise classes to attend, and a significant other to keep reasonably happy.  And, somewhere between all of those responsibilities you need to sleep too, right?  So, where would you find the time to write a book?

The good news is that the 282 SAS Press authors who wrote a total of 200 SAS books weren’t that much different than you are.  They had work responsibilities, domestic obligations, and personal tasks that kept them busy.  And, they did get some sleep too.  Yet, they did manage to find the time to squeeze writing into their busy lives and become published authors.  So, it obviously can be done.

I juggled my own real life and writing when I wrote my first book, the second edition of that book, my second book, and now when I am writing my third book.  I rearranged my impossibly busy schedule so that I would have the time to realize my ambition of presenting written technical material to other SAS professionals.  It can be done.  Believe me; when you sign a book contract with SAS Press, you find the time. 

Maybe you can go to work a bit earlier so that you can come home earlier and write.  Perhaps you don’t need to sleep so late on the weekends.  Maybe you can switch off child care or pet care activities with your significant other.  Try skipping a few parties for a while; you will earn brownie points when people find out you are home working on your book.  Do you really need to catch those TV shows now when you can watch them as reruns in the summer? If you really put your mind to it, then by bits and pieces you can reclaim parts of your busy week to write.

Don’t have the time to write a book for SAS Press?  Think again!

You can learn more about Michael Raithel and his work by visiting his author page.

Post a Comment

SAS author's tip: Using MLOGIC

This week's SAS author's tip comes from Carol Matthews and Brian Shilling and their book Validating Clinical Trial Data Reporting with SAS.  SAS users have raved about this guide. In her review, Susan Fehrer said "Carol and Brian's book provides a good overview, practical hands-on tips, and many examples of how to perform a thorough validation. The authors' written style allows the reader to almost see and hear Carol and Brian sitting nearby in conversation. . . . The SAS programming examples in the book are very clear and easy to follow. This is a good reference book for all statistical and clinical SAS programmers."

If you like this week's tip, you can read a free chapter from the book here.

The following excerpt is from SAS Press authors Carol Matthews and Brian Shilling and their book "Validating Clinical Trial Data Reporting with SAS" Copyright © 2008, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED. (please note that results may vary depending on your version of SAS software)

4.2.3.3 Using MLOGIC

Another SAS option that is very useful for validating and debugging complex macro code is MLOGIC. Again, this option produces many extra lines in the log so it is often only turned on during the validation process and turned off during production. It is also most useful when working with complex macro logic that directly affects what code is submitted to the SAS compiler (and hence MPRINT does not show evidence of the macro compilation). When you are using the same code as Example 4.14, the MLOGIC option shows the following in the log:

Notice how the bold row differs from the note produced by the SYMBOLGEN option. In this case, not only does MLOGIC list the value to which macro variable &VALID resolves, but it also reports how the macro compiler resolved the logical IF statement (in this case, FALSE). While this is a very simple example, it is easy to imagine how this option could facilitate the validation and debugging of macro code with more complex logic.

Post a Comment

Five reasons to see us at PharmaSUG

Between attending presentations and networking, you should make your way to the SAS Bookstore at PharmaSUG. While there are many reasons to add us to your list, here are the top 5:

  1. Save money on our books and documentation. We’re offering a special conference discount to PharmaSUG attendees.
  2. Talk to a SAS Press acquisitions editor about getting published or about your book topic ideas. Editor John West is a long-time, popular representative for us. He’s looking forward to speaking with prospective authors in San Francisco. Stop by and see him.
  3. Come see our latest books and documentation. Also, browse preview copies of several upcoming titles.
  4. Meet SAS Press authors and look for their work in our bookstore. Several of our authors are presenting this year.
  5. Follow @SASPublishing on Twitter and look for opportunities to win books onsite.
Post a Comment

Four reasons to use SAS/GRAPH

Robert Allison's SAS/GRAPH: Beyond the Basics collects examples that demonstrate a variety of techniques you can use to create custom graphs using SAS/GRAPH software. To celebrate the book’s publication, we asked Robert to tell us more about why he loves SAS/GRAPH. Here’s what he had to say:

  1. A graph is a lot easier to understand than raw data. (This is true for a few data points, or thousands of data points.)
  2. “Visual Analytics” will be very important in the future.
  3. Simple default graphs are ok … but if you can customize the graphs to be more “targeted,” this makes it easier for you to find what you’re looking for in the graph.
  4. SAS/GRAPH is the #1 best software I know of for creating custom graphs! 

Written for the SAS programmer with experience using Base SAS to work with data, the book features examples that can be used in a variety of industry sectors. They include: Customizing a Map, a Custom Waterfall Chart, Plotting Data on Floor Plans, GIF Animations, and an Advanced Dashboard.

Robert is a big fan of the software and he certainly knows his stuff when it comes to SAS/GRAPH. We’re big fans of Robert and his new book. Find out what other techniques you can learn, read a free chapter, and get your copy today!

Post a Comment