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;


see_title_my_pdf.png
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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