ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
Louis_Gallo_CIGNA_com
Calcite | Level 5

I'm new to SAS, and I'm using SAS Enterprise Guide 4.3 with SAS 9.2 on Windows. I'm confused about using the ODS PDF driver. I can create great plots using SGPLOT, but any ODS options that I try using are ignored.

For instance, in the following code, The title refuses to print. The graph looks fine otherwise.

options nodate nonumber;

ods pdf file="&PDFOUTPUTFILEGRAPHPHYSCPUUSAGE";

proc sgplot data=WORK.SORTTempTableSorted2; 

Title "&HOSTNAME - &REPORTTITLE1"; 

band x=dt1 lower=0 upper=pctwio / legendlabel='%WIO'; 

band x=dt1 lower=0 upper=pctusr / legendlabel='%User'; 

band x=dt1 lower=0 upper=pctsys / legendlabel='%Sys'; 

band x=dt1 lower=0 upper=pctnice / legendlabel='%Nice'; 

band x=dt1 lower=0 upper=pctsteal/ legendlabel='%Steal'; 

XAXIS LABEL= 'Timestamp'; 

YAXIS LABEL= '%';

RUN;

Any help is appreciated.

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  I don't understand what you mean by ODS OPTIONS? What options did you try that were not used. The only ODS statement you show is the ODS PDF statement. There are NO other ODS STATEMENTS in your code. I no longer have SAS 9.2 to test with, but when I ran the test code using SGPLOT I do see my Wombat - Title in the Title area of the graph. See the attached screen shot. If you are not seeing the same thing, then it might be something specific to 9.2 or it might be something else. ODS GRAPHICS were first introduced in 9.2, so there is a chance that the TITLE statement behaved differently, but I don't remember having issues with the TITLE statement. But, Tech Support can test the code in 9.2 and help you figure out what options you want to add/use.

  I notice you are using a dataset of WORK.SORTTempTableSorted2 which looks like an Enterprise Guide generated name. The other possibility is that there is something in your project or EG options or EG additional code that is not being honored. Again, a question for Tech Support.

Cynthia

options nodate nonumber;

%let hostname = Wombat;

%let REPORTTITLE1 = Title;

 

ods pdf file="c:\temp\trytitle.pdf";

 

proc sgplot data=sashelp.class; 

Title "&HOSTNAME - &REPORTTITLE1"; 

  scatter x=height y=weight;

  XAXIS LABEL= 'Timestamp'; 

  YAXIS LABEL= '%';

RUN;

ods _all_ close;


undefined
Louis_Gallo_CIGNA_com
Calcite | Level 5

Hi Cynthia,

Thanks so much for responding. You were right. It was something specific to Enterprise Guide. I had to set the "Results Format" to use PDF as its default. In EG, "Tools" ==> "Options" ==> "Resuts General" and set the "Results Formats to include PDF.

I found that in this article: http://support.sas.com/resources/papers/proceedings12/145-2012.pdf

Thanks for your help!!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2371 views
  • 0 likes
  • 2 in conversation