Susan Slaughter

Archive for February, 2011|Monthly archive page

Sunil’s Top 10 SAS Papers: Guest Blog by Sunil Gupta

In Enterprise Guide, Everything, Guest Blog, SAS, SAS Papers on February 18, 2011 at 10:59 am

Sunil's Top 10 SAS PapersI recently learned about an interesting resource for SAS users.  Sunil Gupta—a SAS Press author and consultant—maintains lists of his favorite SAS papers on various SAS-related topics.  You can peruse these lists on his page on

Here are some of Sunil’s Top 10s:

Sunil’s Top 10 PROC FORMAT/Functions Papers

Sunil’s Top 10 PROC COMPARE Papers

Sunil’s Top 10 SAS Macro Papers

Sunil’s Top 10 SAS Dictionary Tables Papers

Sunil’s Top 10 ODS Papers

Sunil’s Top 10 DATA Step/MERGE Papers

Sunil’s Top 10 SAS Certification Exam Papers

Sunil’s Top 10 SAS Enterprise Guide Papers

Sunil’s Top 10 Pharmaceutical Industry Papers

Susan’s Macro Mottos

In Everything, Little SAS Book Series, SAS, SAS Global Forum, SAS Papers on February 10, 2011 at 2:56 pm

With SAS Global Forum less than two months away, I am busy putting the finishing touches on my papers.  One of those papers is SAS Macro Programming for Beginners. Of all the conference papers I have written over the years, this is probably my favorite.  Yet oddly, I have only presented this paper once at SGF and that was long ago.  So I am pleased to have an opportunity to dust this paper off.

Don’t expect a lot of advanced macro tricks here.  This paper is exactly what the title says: macro programming for beginners.  It’s a crystal-clear presentation of the basic concepts you need to understand in order to be comfortable in the company of SAS macros.  I can summarize the paper in two sentences that I call “Susan’s macro mottos.”  Here they are:

Susan’s Macro Mottos

Remember: You are writing a program that writes a program.

This is the most important concept to keep in mind whenever you write or debug SAS macros.  If you feel the least bit confused by a macro, repeating this motto can help you to see what is going on.  I speak from personal experience here. This is my macro mantra.

To avoid mangling your macros, always write them one piece at a time.

First write your program in standard SAS code. When that is working and bug-free, then add your %MACRO and %MEND statements. When they are working, then add your parameters, if any, one at a time.  If you make sure that each macro feature you add is working before you add another one, then debugging will be vastly simplified.

If you are lucky enough to attend SAS Global Forum and you want to catch this presentation, look for me in the Milano V-VI room Tuesday April 5, 2011, 10:30-11:20 am.

Click here to download the paper.