- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yep, sorry, should be on the ods excel line per:
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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):
With NOGTITLE, NOGFOOTNOTE (title is OUTSIDE graph image):
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Cynthia_sas, interesting to see that, but for whatever reasons, can't get it to work for me.
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What exact version of SAS are you using ie SAS 9.4 TS1M4?
ODS EXCEL isn't production until SAS 9.4 TS1M3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Reeza,
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That translates to SAS 9.4 TS1M3 - ODS Excel is production so it should work fine for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;