Art Carpenter

12月 082016

As technology expands, we have a similarly increasing need to create programs that can be handed off – to clients, to regulatory agencies, to parent companies, or to other projects – and handed off with little or no modification needed by the recipient. Minimizing modification by the recipient often requires […]

The post Using the SAS Macro Language to Create Portable Programs appeared first on SAS Learning Post.

8月 042016

Color Names, Formats, Macros, ODS, Excel®, and PROC REPORTNot too long ago I had a report generation request from an Alaska state agency. The request had some very specific requirements that detailed the use of user defined colors (by name), data driven control of the report, and Excel delivery using ODS and PROC REPORT. Along the way I had to: determine what colors are known to SAS by name; develop a user tool for color selection that would feed uniformly into a data driven table; construct formats based on the data that would match the user selected colors to specific types of report cells; and deliver the report using Excel. The process was interesting enough that it has resulted in two papers, which I will present at WUSS, September 7-9 in San Francisco.

In these two papers the process for discovering how to name, select, and display the colors is described. Formats are built from the color names and the reported data (DATA steps with two SET statements are used to perform a data merge). Traffic lighting is used is used at the cell level in PROC REPORT, and the whole process is driven by macros. Talk about a fun project! For those of you unable to join me in San Francisco for the full talk, here are two quick tips on how to do this.

Extracting color names from the SAS Registry

The names of available colors are stored in the SAS Registry. They can be extracted to a file through the use of PROC REGISTRY. The following REGISTRY step writes the list of color names and their HEX definitions to the text file COLORNAMES.TXT.

proc registry export= "colornames.txt" 

Displaying a list of colors

If a list of color names is stored in a SAS data set, those colors can be displayed using PROC REPORT. In the following REPORT step, an Excel spreadsheet is created that shows the list of available colors that are stored in WORK.COLORS both with and without the color in the cell background.

proc report data=work.colors;
  column  colorname colorname=clr; 
  define colorname/ 'Color Name';
  define clr  / 'Color';
  compute clr /char length=35; 
     call   define(_col_,'style','style={background='||colorname||'}');

I hope you enjoyed these tips. Please join me for the complete talk at the Western Users of SAS Software Educational Forum and Conference, September 7-9 at the Grand Hyatt on Union Square in San Francisco.  Discounted registration is still available through August 8th! Register now. It’s a great three days of educational opportunities, 100+ presentations, classes, workshops, networking and more.

Visit for more information.

Editor's note: If you can't attend WUSS 2016 but would like to view Art's paper in it's entirety, the conference has plans to publish conference proceedings after the event.  

tags: ods, PROC REPORT, SAS ODS, US Regional Conferences, wuss

Tips for working with Color Names, Formats, Macros, ODS, Excel®, and PROC REPORT was published on SAS Users.

11月 122015

As I visit my clients, it sometimes surprises me when they avoid the use of PROC REPORT.  “It’s too different”.  Even those that do use it, often fail to take advantage of the procedure’s power by ignoring the compute block.  Yes this procedure is different from any other. Yes using […]

The post You’re not using PROC REPORT? appeared first on SAS Learning Post.

9月 152015

WritingWhen I wrote my first paper, a poster for SUGI 13, yes it was SUGI back then, not SAS Global Forum, I had no idea what a wonderful journey I was embarking on. At the time, I thought that paper was just a way to get to a conference. That was in 1988. Now over a hundred SAS papers and five SAS books later, and with the benefit of hindsight (believe me, foresight and a future as a writer were not in the mix), I can see the many doors that were opened by that initial paper.

Writing and presenting that first paper helped me meet other presenters, SAS users, and conference leaders. Those contacts helped me become involved as a conference organizer, section chair, and eventually the 2003 conference chair for SUGI 28.

Writing also helped me learn to write. Looking back, that first paper was really not all that good. My first book contribution (two articles in the now out of print Reporting from the Field), wasn’t that great either. But, by the time the Books by Users (now SAS Press) acquisition editor, David Baggett, talked me into writing my first book (Quick Results with SAS/GRAPH® Software), I had written 15 invited and contributed papers and posters and my writing had improved.

Now, writing is fun for me. In fact, I wish I had more time to write about SAS and to share what I have learned about this incredibly powerful and complex language. It is most fun when writing about one of the areas or topics that I am most familiar with. That very first paper was about the macro language, and the techniques that it attempts to describe are still useful today over 25 years later.

So where are you in your writing journey? That first paper submittal can be the hardest, but there are many more opportunities now than there were 25 years ago. Local user groups abound, are less threatening, and are always looking for new content. Visiting Alaska? Make it a business trip and speak at an AKSUG meeting. Most of the regional user conferences have e-posters (you don’t present to an audience), as well as Quick Tips (aka Coder’s Corner), which are short (10 minute) single topic presentations. There are also opportunities for 20 and 50 minute presentations for more involved topics.

Trust me, SAS users make great audiences. We all want to learn more and there is always more to learn. You can contribute to our learning experience. What SAS topics do you care about? What cool tip or trick did you just learn? Others may know about it, but many will not – so share it. Set aside a bit of time to collect your thoughts. You may want to write and submit a paper for SAS Global Forum 2016. Or perhaps you may want to write a short tip or even an article on the SAS user’s wiki I encourage you to have fun with the writing and with presenting. Join in the journey. It has proven to be a very rewarding part of my SAS career.

Don’t forget to submit your abstract for SAS Global Forum 2016 by October 7. You can even enroll in the SAS Global Forum Presenter Mentoring Program to gain some help with writing your abstract, title and paper. I am planning on being a mentor. Perhaps we will work together on your paper.


tags: SAS Global Forum, sas presenters series

The Fun and Reward of the SAS Writing Journey was published on SAS Users.

8月 232013
Call them tricks or call them nuggets of information. With a language as complex and versatile as SAS there are any number of small bits of knowledge that we accumulate and use – sometimes without even thinking about them.  Often we discover a gem of information, but what gems have we [...]