ods

5月 262011
 
SAS Enterprise Guide has about 150 options that you can customize in the Tools->Options window. With each release, the development team adds a few more options that have been asked for by customers, and they rarely decommission any existing options. It's getting quite crowded on some of those options windows!

Alas, the team has not yet discovered how to implement the "Read my mind" option (but believe me, it's been requested), so it remains up to you to investigate the options that are offered and select those that suit the way that you want to work.

I use SAS Enterprise Guide every day to get work done, and I've got some favorite settings that I like to run with that help me to be more productive. Here are my top 5.

Replace results: Replace without prompting

How to find it: Tools->Options->Results->Results General, under the Managing Results heading.

The Replace Results option
After you set this option, you'll never again see this message "Do you want to replace results? Yes, No, or Cancel" when you re-run a task or program. Your results will always be replaced, which is what most people almost always want.

Turn off Show generated wrapper code in SAS log

How to find it: Tools->Options->Results->Results General...about halfway down the window. This option really helps to declutter your SAS log within SAS Enterprise Guide. I've written about this option in more detail in a previous post.

Show full details when viewing SAS libraries in File Dialog

How to find it: Tools->Options->General...about 1/3 of the way down the page. Checking this option allows you to see more details about the data sets in your libraries before you add them to your project. Read more about the File Details option in an earlier post.

Turn off Show Welcome window at start-up

How to find it: Tools->Options->General...top option. Or, check the box that says "Don't show this window again" the next time you see the "Welcome to SAS Enterprise Guide" window. This tells SAS Enterprise Guide, "Hey, the honeymoon is over. Get out of the way and let's get to work."

The Welcome window does provide handy one-click access to your most recently used projects. But you can also get to those via File->Recent Projects. Bonus added in the 4.3 release: File->Recent Programs, which provides easy access to SAS program files that you've opened recently.

Change default SAS Report style to Plateau

How to find it: Tools->Options->Results->SAS Report, Appearance section. The default ODS output style for SAS Report is Analysis. It's a nice clean style, but I prefer Plateau because it's a bit more concise and can fit more information on a screen. Here: take a look at this sample to see what I mean. There are lots of different styles: experiment and see which one you like the best.

Change Graph Format to PNG

How to find it: Tools->Options->Results->Graph, Graph Format. The PNG graph option

The default graph format for items such as bar chart and line charts is ActiveX. ActiveX has been the default output format in SAS Enterprise Guide since 1999, when the product shipped with version 1.0 on top of SAS Version 8. Back then, the quality of the charts produced using the ActiveX graph control was pretty impressive when compared to the output produced using GIF or similar static chart types.

The ActiveX device tells SAS to generate verbose scripting code as part of the SAS Report or HTML output. Then a client-side control is used to render the graph. This allows for some interactivity in the graph, but it also comes with a limitation: if the graph contains lots of data points, the script gets larger, and that can make for a very large output file.

SAS/Graph has come a long way since the early days of SAS Enterprise Guide, and with SAS 9.2 we like to recommend the PNG device for most applications. The PNG (or GIF or JPEG devices) respect the SAS graph styles and look pretty nice. If you use ODS Graphics (or the SGPLOT procedure), you get PNG already since ActiveX isn't supported.

Whoops, that's 6 options, not 5! Once I get going it's difficult to stop. I've got some other favorites that I recommend for certain situations (working with databases, making the best of network latency, collaborating with teammates on projects); those will provide good topics for a future post.

What about you? Do you have a favorite set of options for SAS Enterprise Guide, or even SAS in general? Post back in the comments.

4月 292011
 
ods listing close;
ods html path='c:\sasdata' body='ods01.html';
proc format;
    value $sexfmt  'F'='Female'
                     'M'='Male';
      value $sexback 'F'='red'
                     'M'='Green';
      value $actback 'LOW'='cxBBDDCC'
                   'MOD'='cxAACCBB'
                   'HIGH'='cx99BBAA';
run;
proc tabulate data=sasuser.admit format=4.1 style={background=ywh};;
      var fee / style=<parent>;
      var age height weight / style={background=yellow};
      class sex actlevel / style={background=white};
      classlev sex / style={background=$sexback.};
      classlev actlevel / style={background=$actback.};
      table sex*actlevel*(age height weight fee*{style=<parent>}), min max mean sum / box={style={background=ltgray}};
      keyword min max mean sum/ style={background=orange};
      format sex $sexfmt.;
run;
ods html close;
ods listing;

The SAS System

BOX Min keyword Max keyword Mean keyword Sum keyword
Sex CLASS ActLevel CLASS   34.0 44.0 39.8 159
Female
CLASSLEV
     +
$sexcolr.
HIGH CLASSLEV
     +
$actcolr.
Age VAR
Height VAR 66.0 69.0 67.0 268
Weight VAR 140 163 149 596
Fee VAR+
<parent>
125 *{style=<parent>} 150 *{style=<parent>} 137 *{style=<parent>} 549 *{style=<parent>}
LOW CLASSLEV
     +
$actcolr.
Age VAR 22.0 49.0 32.5 130
Height VAR 61.0 64.0 62.5 250
Weight VAR 118 172 138 552
Fee VAR+
<parent>
85.2 150 111 445
MOD CLASSLEV
     +
$actcolr.
Age VAR 32.0 43.0 39.3 118
Height VAR 63.0 67.0 65.0 195
Weight VAR 123 151 137 411
Fee VAR+
<parent>
125 150 141 424
Male
CLASSLEV
     +
$sexcolr.
HIGH CLASSLEV
     +
$actcolr.
Age 25.0 29.0 27.0 81.0
Height 72.0 76.0 74.3 223
Weight 168 193 183 549
Fee 85.2 125 98.4 295
LOW CLASSLEV
     +
$actcolr.
Age 34.0 60.0 48.3 145
Height 71.0 73.0 71.7 215
Weight 154 191 168 503
Fee 125 150 133 399
MOD CLASSLEV
     +
$actcolr.
Age 30.0 54.0 41.5 166
Height 69.0 72.0 70.5 282
Weight 147 183 169 676
Fee 125 150 144 574

4月 132011
 
Just flew back from Vegas, and boy, are my arms tired! (ba-dump)

If you attended SAS Global Forum, you probably learned a lot of things you didn't know. But if you were a SAS employee, you also learned a lot of things you didn't know. One of the perks of being able to attend SAS Global Forum as an employee is the opportunity to find out (and try out) new features in the software as well as to find out the latest information about our services. So, without further ado, here are 4 Things I Learned at SAS Global Forum:

  1. You folks are crazy about SAS! My paper on "SG Procedures for the Non-Statistician" was scheduled for 8:00 AM on the final day of the conference, in a city where there are more than a few excuses to stay out late. I was expecting that my presentation would wind up being a dialogue between me and the session chair, while reasonable people slept in late. However, we had a full room of graphics fans, even at that early hour!

  2. ODS Graphics is getting the ultimate power tool. I attended Dan Heath and Sanjay Matange's presentation on Annotate for SG Procedures and the ability to annotate graphs (coming in SAS 9.3) makes the SG procedures the tool of choice for both statistical and non-statistical graphics applications. The Annotate facility for ODS graphics will be similar to Annotate for "classic" SAS/GRAPH procedures--you create a data set containing observations that control what is added to a graph. Most importantly, data-dependent annotation will be supported.

  3. A lot of people are interested in e-Learning. I spent most of my time in the Demo Area near the Self-Paced e-Learning Demo, where SAS users had a chance to try out some of our e-Learning courses. As I mentioned in a previous post, this is a good way to learn SAS when your schedule won't permit you to take a course on a fixed schedule.

  4. You'll get instant graphs with the SG procedures in SAS 9.3. If you are currently using ODS graphics (including SG procedures), you have to click on the graph in the Results window to display it with your host graphics viewer. In SAS 9.3 ODS graphics will generate HTML output by default and the output will immediately display in the SAS Results Viewer, thus saving you the step of explicitly having to open the graph.
      And if you've stayed with me so far, here are 5 things I learned about Las Vegas in general:

      1. There are few things in life worth $125 a ticket, but Cirque de Soleil's LOVE is one of them. Words can't describe it, so I won't try. Just save up and go.

      2. If you are coming to Las Vegas and you don't gamble, bring your own chair. I knew that there were no clocks or windows in the casinos, but I didn't know that there is no place to sit in a casino or hotel lobby except at a slot machine.

      3. Las Vegas appears to have a local ordinance requiring you to smoke. If you are a male between 45 and 60, you must smoke a cigar.

      4. Even if you don't like New York, New York, New York New York is neat. (This sentence is actually grammatically correct).

      5. Bring money. Lots of it. And bring even more.

      Thankyou. Thankyouverymuch. You've been a wonderful audience.


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.