Chris Hemedinger

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.

12月 112010
 
I helped to write a quiz for the Computer Science Education Week promotions that were featured on our company intranet. Do you fancy yourself as a Comp-Sci aficionado? Let's see how you do with these.

1. Which achievement is Charles Babbage most famous for?

  1. Establishing software retail shops in shopping malls across America
  2. Inventing a strategic card game that involves using pegs to keep score
  3. As one of the "fathers" of the programmable computer
  4. Earning an all-time high score while playing Mafia Wars

2. Early computer programs and data were originally recorded on what storage device?

  1. Iomega "Zip" drives
  2. 8" floppy disks
  3. Punched cards
  4. 8-track cassette tapes

3. Which of the following is NOT a computer programming language?

  1. Lisp
  2. Python
  3. Ruby
  4. Simba
  5. SAS

4. Within a computer program, a function that can invoke itself again as part of doing its work is known as:

  1. recalcitrant
  2. recursive
  3. redundant
  4. repulsive
  5. a stack overflow exception

5. In a computer program, a variable that simply holds the memory address of another variable or data structure is called:

  1. a memory leak
  2. a pointer variable
  3. a linked list
  4. an address box

Answers:

1: (c). Charles Babbage is known as a pioneer in the concept of a programmable computer, even though he lived long before the technology to build modern computers was invented. Source: Wikipedia (http://en.wikipedia.org/wiki/Charles_Babbage)

2: (c). Punched cards have been around since the earliest "computing machines". Beginning in the 1960s, magnetic tape and other storage devices began to replace punched cards for data storage. Source: Wikipedia (http://en.wikipedia.org/wiki/Punched_card)

3: (d). At the time of this writing, there is no computer programming language named "Simba"…but it's probably just a matter of time. The most popular active programming languages are tracked at the TIOBE Programming Community Index (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html). The SAS programming language is currently at number 18 on the index.

4: (b): "Recursive" is the most correct answer here, but unless used with extreme care, any of the other answers might be the result.

5: (b): A pointer variable (or pointer, for short). Pointers are common in some programming languages, such as C and C++, where they are usually essential for memory-efficient operations. Those who work with higher-level languages such as Java, C#, or even SAS don't encounter pointers nearly as often (the lucky stiffs).

12月 082010
 
I connect to more SAS server environments than your average SAS user. In a given week, I probably run SAS Enterprise Guide connecting to at least five different Windows-based servers, a few Unix-based servers, and maybe even a z/OS machine as well.

With that many SAS environments, I'm bound to encounter one or two with a SETINIT that's in its "warning" mode: you know, when the initialization log tells you that your SAS products will expire soon and you need to renew your SETINIT (via a SAS Installation Data, or SID, file). (Yes, even inside the walls of SAS, we use SETINITs to keep our software installations working.)

Sometimes I connect too late, and the license has already expired. If that happens, you don't get a nice message from SAS Enterprise Guide that tells you why you can't connect. The message is simply, "Failed to start the SAS server." Without a current SETINIT, a SAS workspace won't start at all, and so we can't get more detailed information than that.

NOTE: This is different from the expiration date sometimes encountered in older SAS Enterprise Guide clients, which has nothing to do with SETINITs.

So for my own selfish purposes, I added a new warning message into SAS Enterprise Guide 4.3. You'll see it whenever you connect to a SAS server that has entered its "warning" stage. I encountered it today (and thanked myself for adding it!); here's what it looks like:

SETINIT Warning via SAS Enterprise Guide

What should you do when you see this warning? You should share the news, of course, and annoy your SAS administrator to apply a newer SETINIT. (In my case though, that's often me.)

I hope that this small touch serves you well, and gives you plenty of warning the next time your SAS licenses are coming close to term.

3月 232009
 
Humor writer and Pulitzer-Prize-winning columnist Dave Barry inspired SAS Global Forum attendees during his keynote presentation at the Technical Session.

Dave Barry introduced his topic: “High-speed access to DBMS data using SAS 9.1.3 Data Engines”

No, that wasn’t it. He just plucked that from the schedule.

Then he started with an honest statement: he had never heard of the SAS Global Forum. So he went to the Internet to do some research. And do you know what he found? He found “that there is a lot of pornography on the Internet.”

When Dave was sitting backstage listening to the technical demos, he was really intimidated that the audience probably understood all of these technical terms that were being used. He gleaned from the presentations one really good word that, if you are in business today, you should use whenever possible. That word is “algorithm”.

If your boss asks you to do something, and you aren’t sure how to do it, just say something like “well, we’d have to build an algorithm for that.” It works against managers like garlic works against vampires.

Dave admits, “I’m not a computer expert. But I do use a computer. I have a computer that informs me, regularly, that I have unused items on my desktop.” Not quite sure what to do about that.

Dave spent some time talking about where he lives: Miami. “I moved there in 1986, from the United States,” he said. He found the driving habits of Miami residents difficult to get used to, until he began to understand, “in Miami, everyone is driving according to the law -- of his/her country of origin.”

Dave related the story of a 73-year-old man who drove his Chevy Cobalt onto runway 9 of the Miami-Dade airport. “I can’t even get near that place with shampoo. But this guy got in with a Chevy Cobalt. Maybe he had it in one of those see-through zippy bags that makes everything alright.”

Dave also recounted the story of a 75-lb bale of cocaine that was thrown from an airplane and almost hit the chief of police in Miami. That sort of thing doesn’t happen in Milwaukee. Miami’s department of tourism slogan: “Come back to Miami, we weren’t shooting at you.”

As a humor writer, Dave described his job like so: ”I sit around, in my underwear, and make things up. Sort of like a consultant. [boost of applause from the audience] Except that a consultant would be wearing your underwear.”

He relayed a few embarrassing stories about himself, including one about an impromptu (and perhaps unwelcome) conversation with First Lady Barbara Bush, and his use of the Oscar Meyer Weinermobile to pick up his son from middle school. Experiences like these have informed his scientific opinion of what causes spontaneous human combustion. “Sometimes, that’s your only option.”

On getting older and medical exams: “We need a way for the doctor to get to the prostate gland other than the way they do that now.” Dave recently experienced his first colonoscopy, but it wasn’t as bad as he feared. However, the preparation was less than pleasant. “The doctor prescribes a nuclear laxative. It’s so explosive that your bowels travel into the future, and you expel food that you haven’t even eaten yet.”

Has Dave Barry ever written a column that he later regretted? Yes, there was that one making fun of North Dakota’s (yes, the state) effort to boost tourism, for which they considered many ideas, including perhaps removing the word “North” from the state name so as to appear, oh, less cold. He received many angry letters from North Dakota citizens, which culminated in Dave Barry being invited to North Dakota, during January, to commemorate them naming a public facility after him. The “Dave Barry Lifting Station 6” – a sewage lifting station.

Dave, like everyone else at the conference, had something to say on the economy. Obviously it’s in horrible shape, but Dave says not to worry. Congress has a plan to spend hundreds of billions of dollars with no idea as to who’s getting it. “I don’t see how that can fail, do you?”, he asked.

On to the inspirational story… One of Dave Barry’s favorite columns was about a group of guys who had to overcome an obstacle, and they were very innovative about it. He’s speaking, of course, about the Oregon State Highway Division and their effort to clear an Oregon beach of a large whale carcass -- using dynamite. I won’t relay the story here, but there is a web site dedicated to the event and others like it.

Dave closed with an excerpt from his book Dave Barry’s Complete Guide to Guys. The story illustrates how different the thought processes are between men and women – mainly, that women think a lot, and men, as difficult as it is for women to believe, actually think very little. His advice to women: “Lower your standards.” (Honey, are you reading this?)


[Want more? Go "behind the scenes" with Chris' interview with Dave Barry on The SAS Dummy blog.]