ods

2月 162011
 

In my last blog post, I discussed how to use SAS options to send unattended email using an SMTP server. In this segment, I’ll tackle creating “pretty” email (using HTML) and sending out emails with attachments. First, I produced a basic report using ODS. I liked the look, and set out to replicate it in the body of my email.



Continue reading "Jedi SAS Tricks: Email from the Front – Part 2"
12月 182010
 
You might be too young to remember Clara Peller. She was the star of a series of fast-food burger commercials in the 1980s, in which she demanded meatier meals by shouting "Where's the beef?" at the pickup counter or drive-through window. Alas, the competitor restaurant meals were afflicted with "Fluffy bun", meaning that it was difficult to find the all-beef patty because it was dwarfed by the bread in which it was served.

SAS Enterprise Guide can also serve up some meaty content in the SAS log when you run a SAS program. But in order get that content to you from your SAS session, SAS Enterprise Guide wraps your program in what we call the "ODS sandwich" -- SAS statements that open and close one or more ODS destinations around your program, so that your results can be packaged from SAS and delivered into your project view.

Sometimes, the ODS sandwich can obscure the content that you're really interested in. Consider this log:


1   ;*';*";*/;quit;run;
2   OPTIONS PAGENO=MIN;
3   %LET _CLIENTTASKLABEL='Program';
4   %LET _CLIENTPROJECTPATH='';
5   %LET _CLIENTPROJECTNAME='';
6   %LET _SASPROGRAMFILE=;
7  
8   ODS _ALL_ CLOSE;
9   OPTIONS DEV=ACTIVEX;
NOTE: Procedures may not support all options or statements for all devices. For details, see the documentation for each procedure.
10    GOPTIONS XPIXELS=0 YPIXELS=0;
11    FILENAME EGSR TEMP;
12    ODS tagsets.sasreport12(ID=EGSR) FILE=EGSR STYLE=Analysis
12  ! STYLESHEET=(URL="file:///C:/Projects/f2ec43/winclient/Build/Debug/Styles/Analysis.css") NOGTITLE NOGFOOTNOTE
12  ! GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");
NOTE: Writing TAGSETS.SASREPORT12(EGSR) Body file: EGSR
13  
14   GOPTIONS ACCESSIBLE;
15   proc means data=sashelp.cars;
16     class origin;
17   run;

NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.16 seconds
      cpu time            0.04 seconds
18        
19   GOPTIONS NOACCESSIBLE;
20   %LET _CLIENTTASKLABEL=;
21   %LET _CLIENTPROJECTPATH=;
22   %LET _CLIENTPROJECTNAME=;
23   %LET _SASPROGRAMFILE=;
24  
25   ;*';*";*/;quit;run;
26   ODS _ALL_ CLOSE;
27  
28  
29   QUIT; RUN;
 

There are only a few lines of interest here, but lots of fluff. It's necessary fluff, mind you. Just like you wouldn't want the fast-food restaurant to hand over your burger (and all the fixins) without a bun, you need to use ODS to deliver your output. But it's not what you came for.

In SAS Enterprise Guide 4.2 and 4.3, you can change an option to hide the fluff in your log. Select Tools->Options and go to the "Results General" page. See the checkbox option that says "Show generated wrapper code in SAS log"? If you clear that checkbox, the ODS sandwich will be hidden from you when you run your programs. (If you're curious how this works, this is the technique that we use.)

Here's the previous example with this option cleared, sans the fluffy ODS bun:


1    ;*';*";*/;quit;run;
2    OPTIONS PAGENO=MIN;
3    %_eg_hidenotesandsource;
18  
19   proc means data=sashelp.cars;
20     class origin;
21   run;

NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.04 seconds
      cpu time            0.06 seconds
22  
23   %_eg_hidenotesandsource;
35  
36  
37   QUIT; RUN;
 

Look carefully at the log. You'll notice that the line numbers are not consecutive -- it skips a few! That's because the ODS statements are still submitted and processed, but the log output for those statements is suppressed. The result is a cleaner log, with more meat than fluff.

We know that many programmers work in regulated industries, and aren't permitted to suppress portions of the SAS log like this. That's why the option is set to "show all" by default. But if you're in search of "just the beef", give this handy option a try.

11月 202010
 

I was building a nice little PDF report the other day.  I love the way ODS PDF replicates the SAS Results window navigation structure as PDF bookmarks, but... I'd much rather write the text for the bookmarks myself.  So, I decided to "use the SAS" and make ODS do my bidding. I was able to use ODS PROCLABEL to change the top-level titles, but those second level bookmarks had a mind of their own, and I couldn't seem to get rid of them.  Cynthia Zender showed me how to trick PROC REPORT to produce the desired result, but I had to resort to ODS DOCUMENT trickery to bend SAS/Graph to my will.  For my very first "Jedi SAS Tricks" blog, I thought I'd share the adventure (and the code) with you.  Don't worry - we'll not dabble in the dark side...


Continue reading "Jedi SAS Tricks: Custom Bookmarks"
3月 242009
 
In hopes of adding to your SAS Global Forum experience, we've kicked off a SAS presenters series. Here, we’ve asked some of the SAS presenters five questions to learn more about what makes them tick, why they chose to present and what they hoped you would take away from the presentation. Take a look at Eric Gebhart’s answers.

Eric Gebhart, Software Developer

Eric, tell me something about yourself that our readers might not believe.
There is lots of stuff to answer this with. I've been unicycling since I was eleven. Recently, at a WUSS luncheon, I was asked to give a short keynote. (Not exactly a keynote. They wanted someone who would provide something a little different.) I presented while riding my unicycle.

I'm also fairly geeky. I use an Apple PowerBook Pro to do all my work. It's refreshing to be in Unix environment since that is where I started programming in 1981. I enjoy playing video games on my Playstation 3: odd games, not so much the violent or sports games. Most recently, I've played Flower and PixelJunk - Eden.

When you say you are fairly geeky, I’m sort of confused to hear of your artsy side. Tell me more about that.
I'm in to fine art, and I always try to go to the museums when I travel. I've also been known to sculpt and paint. Last November I donated two mobiles for an auction to benefit Black Mountain College Museum. I've been making mobiles in my spare time since then.

And, last year I started dancing the Argentine Tango. I’m most likely a tango addict. Earlier this month, I went to Tucson for the Tucson Tango Festival, and I arrived in DC four days early to take advantage of the DC Tango Marathon. I’ll be going to Atlanta the day after SAS Global Forum to attend the Atlanta Tango Festival.

How many times have you been to SAS Global Forum? What was your most memorable experience so far?
Nine or ten, if you count SUGI. I've been to every SAS Global Forum there's been. My first presentation at SUGI in 2000 was the most memorable. I checked my laptop in the tryout room that mirrored my presentation hall. But when I plugged it in, the video didn't work. We ate up 30 minutes of my presentation by the time we finally exported my PowerPoint slides to a CD, and then put the CD in a different computer.

The slideshow forgot all the hidden slides and the order of the slides. I talked really fast and flipped through the unnecessary slides. I coped with them being out of order.

What problem or customer pain were you hoping to solve with ODS Packages: Putting Some Zip in Your ODS Output?
I am giving new information about new or fairly new features that will explain how the features work and how to use them. I think that an understanding of how things work together gives more power to the customer. ODS packages are a new, integral part of ODS that will enable easier packaging of ODS output, but it goes beyond that. Understanding how packages work and interact within ODS gives a thorough understanding of what is possible and what the future holds.

ODS inline formatting is finally production after several years of experimental status. It has a new syntax and new abilities that can be more thoroughly exploited with a little understanding of how things work.

During your presentation, what are the most important highlights or questions that you hoped to cover?
I wanted everyone to leave with enough understanding that they could try all of these things out for themselves. I wanted them to get enough information that they could visualize and then think about how these things can be used to help streamline their processes or make better reports more easily. If I helped my audience think in new ways to solve old and new problems, then I accomplished my goal.

Were there unexpected user questions that will send you back to the drawing board?
3月 232009
 
Does your SAS code lack energy?
Are your macros not 'mending'?
Is your data out of sorts?

Not to fear, because here at SAS Global Forum, we have emergency treatment for your SAS code. The new Code Doctors section allows you to bring your problematic SAS programs to a SAS subject matter expert. Take advantage of this personalized learning experience during two sessions in the Demo Area:

Monday, 10:30 a.m. - 12:30 p.m. and 2 - 4 p.m.
Tuesday, 8:30 a.m. - 10:00 a.m. and 10:00 a.m. - 11:30 a.m.

This is your chance to let the experts advise you, debug your errors or just recommend some fine tuning. Questions can address syntax, logistics or concepts in a variety of SAS areas such as Base SAS, Statistics, Macros, Report Writing, ODS, SQL, SAS Enterprise Guide and more.

Bring a hard copy and/or electronic file with your code and/or log for a Code Doctor to examine. Time will be available for one-on-one consultations.