BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alandool
Quartz | Level 8

Hi All,

 

I am attempting what seems simple and straight-forward, but alas ... I kid myself ..

 

Code below is a simplified version of what I'm trying to do which is simply to use ODS EXCEL to create a graph with a title (or even ODS TEXT), but having no luck.  The graph is produced, but no title / text can be found.  I've tried many different ways.  Thanks for any help you can offer.

 

(using EG 7.1 - Platform Version 9.4)

 

Alan

 

 

ods excel file="C:\wherever\temp.xlsx"
options(sheet_interval="none" sheet_name="sheet 1" embedded_titles='yes');
ods graphics / height=800 width=1200 noborder;

 

TITLE "test graph title";
proc sgplot data=sashelp.cars;
histogram msrp;
run;

ods excel close;

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Make sure that there isn't another ODS destination active.  If running this in EG, you might want to change the properties of your program to close the other destinations (see this article for how), or issue ODS CLOSE _ALL_ before your code.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

11 REPLIES 11
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, its the gtitle and gfootnote optins that need to be enabled.  Think this should work:

ods graphics / height=800 width=1200 noborder gtitle gfootnote;

Haven't got anything to otry it on though.

alandool
Quartz | Level 8

Thank you, RW9.  It doesn't like the gtitle gfootnote options.  Of all the options listed in the error msg, don't see any that looks like it ties to a title or footnote.

 

Alan

 

134 ods graphics / height=800 width=1200 noborder gtitle gfootnote;
______
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ANTIALIAS, ANTIALIASMAX, ATTRPRIORITY, BORDER, BYLINE, DATASKINMAX,
DISCRETEMAX, DRILLTARGET, GROUPMAX, HEIGHT, IMAGEMAP, IMAGENAME, LABELMAX, LABELPLACEMENT, LEGENDAREAMAX,
LOESSMAXOBS, LOESSOBSMAX, MAXLEGENDAREA, NOANTIALIAS, NOBORDER, NOIMAGEMAP, NOSCALE, NOSCALEMARKERS, NOSUBPIXEL,
OUTPUTFMT, PANELCELLMAX, POP, PUSH, RESET, SCALE, SCALEMARKERS, SHOW, STACKDEPTHMAX, SUBPIXEL, TIPMAX, WIDTH.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yep, sorry, should be on the ods excel line per:

http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p09n5pw9ol0897n1qe04...

 

ods excel file="C:\wherever\temp.xlsx" 
options(sheet_interval="none" sheet_name="sheet 1" embedded_titles='yes') gtitle gfootnote;
ods graphics / height=800 width=1200 noborder;

 

alandool
Quartz | Level 8

Tried, but didn't work.  I added the gtitle gfootnote options but still only get a graph, no titles or wording anywhere in the spreadsheet.  I had also read thru that documentation that you linked.  The title works if it isn't a graph.

 

Alan

 

ods excel file="C:\wherever\temp2.xlsx"
options(sheet_interval="none" sheet_name="sheet 1" embedded_titles='yes') gtitle gfootnote;
ods graphics / height=800 width=1200 noborder;

TITLE "test graph title";
proc sgplot data=sashelp.cars;
histogram msrp;
run;

ods excel close;

Cynthia_sas
SAS Super FREQ

Hi:

  You might want to try again. I tried your code as you specified, without any changes and it worked for me as shown below:

With GTITLE GFOOTNOTE, as you specified (title is INSIDE graph image):

works_for_me.png

 

 

With NOGTITLE, NOGFOOTNOTE (title is OUTSIDE graph image):

NOGTITLE.png

 

cynthia

alandool
Quartz | Level 8

Thank you, 

 

Reeza
Super User

What exact version of SAS are you using ie SAS 9.4 TS1M4?

ODS EXCEL isn't production until SAS 9.4 TS1M3.

 

alandool
Quartz | Level 8

Hi 

Thought we were on 9.4, but when I run a proc setinit, this is what comes back.  So, now I'm a little confused about whether we are or not.

 

Current version: 9.04.01M3P062415

 

Alan

Reeza
Super User

That translates to SAS 9.4 TS1M3 - ODS Excel is production so it should work fine for you.

ChrisHemedinger
Community Manager

Make sure that there isn't another ODS destination active.  If running this in EG, you might want to change the properties of your program to close the other destinations (see this article for how), or issue ODS CLOSE _ALL_ before your code.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
alandool
Quartz | Level 8

Awesomeness, Chris!   That worked and EG runs much quicker (info on properties helpful !).   Final code below.

 

Thanks, EVERYONE for your  help and input.  Great help and support here.  

 

Alan

 

ODS _ALL_ CLOSE;

 

ods excel file="C:\wherever\temp2.xlsx"
options(sheet_interval="none" sheet_name="sheet 1" embedded_titles='yes') gtitle gfootnote;
ods graphics / height=800 width=1200 noborder;

 

TITLE "test graph title";
proc sgplot data=sashelp.cars;
histogram msrp;
run;

 

ods excel close;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 11 replies
  • 3023 views
  • 5 likes
  • 5 in conversation