SAS logs in Enterprise Guide: Where’s the beef?

This post was kindly contributed by The SAS Dummy - go there to comment and to read the full post.

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.

This post was kindly contributed by The SAS Dummy - go there to comment and to read the full post.