- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I hope to create a document store and create a "printed" index using the contents option in the ods pdf command. Unfortunately, I'm having trouble creating a "printed" index for just four graphs created using proc sgplot. Without the contents option, I get four graphs on four separate pages. When I use the contents option, I get the index and all four graphs printed on top of each other on the first page followed by four blank pages. Note that the contents option works as expected when I only use proc report. I'm using SAS version and maintenance release 9.04.01M2P072314.
My replay commands are as follows:
ods pdf file=pdfout contents;
proc document name=work.test;
replay;
run;
quit;
run;
ods _all_ close;
The listing of the document store is as follows:
SAS Output
in Bytes Created Modified Symbolic Link Template Label Page Break 1 \SGPlot#1 2 \SGPlot#1\SGPlot#1 3 \SGPlot#2 4 \SGPlot#2\SGPlot#1 5 \SGPlot#3 6 \SGPlot#3\SGPlot#1 7 \SGPlot#4 8 \SGPlot#4\SGPlot#1
Dir | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | ||||
Graph | 3020 | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | Before | ||
Dir | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | ||||
Graph | 3004 | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | Before | ||
Dir | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | ||||
Graph | 3020 | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | Before | ||
Dir | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | ||||
Graph | 3016 | 17NOV2016:14:44:32 | 17NOV2016:14:44:32 | test | Before |
Suggestions would be appreciated.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
...and I'm back.
No good news, I'm afraid. Below is the exact text I received from tech support, so there's no real light at the end of the tunnel.
Tom
----------------------------------------------
There is a defect open with the development team on this issue and I have added this tracking number to that defect. The original problem presented in SAS 9.3 caused a read access violation when contents=yes and images were used, and the solution to that defect presented the overwritten image in the table of contents. The underlying code solution is non-trivial, requiring a re-architecture of the "pageof" logic used by ODS PDF. Such a re-architecture would fix the problems described in both of these SASnotes:
http://support.sas.com/kb/20/666.html
http://support.sas.com/kb/34/573.html
I don't have an ETA for a defect fix to both problems nor is there currently an ODS PDF workaround for the problem you described. The recommendation for creating a printable table of contents with a file containing SAS created images and tables is to use ODS RTF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't feel as though I have enough information to answer your question completely. Have you tried adding an ODS STARTPAGE=NOW; statement between your charts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1. Sorry to complicate the issue with Proc Document. If you look at my document catelog, all of those "Before" entries work the same as starting a new page.
2. I've simplified the problem statement by using code from the first two SAS 9.4 examples for Proc SGPlot and adding the contents option. I get the same problem. I'm just testing on a couple of figures at a time but I need to implement an index on thousands of figures at a time. My new example is as follows:
filename pdfout "!TEMP\SAS Temporary Files\test.pdf";
ods pdf file=pdfout contents startpage=yes;
proc sgplot data=sashelp.class;
scatter x=height y=weight / group=sex;
run;
proc sgplot data=sashelp.revhub2;
scatter x=hub y=revenue /
group=type groupdisplay=cluster clusterwidth=0.5;
xaxis type=discrete;
run;
ods pdf close;
run;
3. I apologize for taking so long to respond. I'm not trying to use this option on my current projects but I will be needing something like it in the near futures.
Chuck
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I can't believe it! I was just logging in to post exactly the same problem, and I saw your post right at the top.
Here's another version of the problem, and anybody can try it out.
Like Chuck, I need a table of contents with SGPLOT output on PDF, and I ran into the same problem. As part of my investigating, I came across a SAS website example of contents with a PDF. Here's the SAS example, slightly changed, which works fine for me:
title "Create a Table of Contents";
options nodate;
ods pdf file="~/GoodReport.pdf" contents=yes;
proc print data=sashelp.class;
run;
proc gchart data=sashelp.cars;
vbar type / sumvar=horsepower;
run;
quit;
proc print data=sashelp.class;
run;
ods pdf close;
Now, if I make the small change of substituting SGPLOT for GCHART in the middle step, the SGPLOT output appears NOT between the two PROC PRINT outputs, but right at the very beginning of the PDF document, overwriting the table of contents.
title "Create a Table of Contents";
options nodate;
ods pdf file="~/BadReport.pdf" contents=yes;
proc print data=sashelp.class;
run;
proc sgplot data = sashelp.cars;
hbar Make / response=Horsepower;
run;
proc print data=sashelp.class;
run;
ods pdf close;
Help!
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Well, there is a SAS Usage note saying that the CONTENTS option on the ODS PDF statement is not compatible with SAS/GRAPH or ODS Graphics output. So I guess you will have to find a workaround -- http://support.sas.com/kb/24/317.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Well, I guess this can be considered solved, although I'm sure you can imagine my next note is going to be to SAS Tech Support asking why I can't have SGPLOT and a table of contents at the same time!!
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I appreciate the usage note and it may still apply but I see that it was issued in 2005 for SAS 9.3. SAS has so much documentation that it's hard to find anything "off the beaten path" but I wasn't able to find any update to the usage note you referenced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Chuck
I've yelled at put in a case to Tech Support to get an update on this issue. As soon as I have a reliable answer from them, I'll post it.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
...and I'm back.
No good news, I'm afraid. Below is the exact text I received from tech support, so there's no real light at the end of the tunnel.
Tom
----------------------------------------------
There is a defect open with the development team on this issue and I have added this tracking number to that defect. The original problem presented in SAS 9.3 caused a read access violation when contents=yes and images were used, and the solution to that defect presented the overwritten image in the table of contents. The underlying code solution is non-trivial, requiring a re-architecture of the "pageof" logic used by ODS PDF. Such a re-architecture would fix the problems described in both of these SASnotes:
http://support.sas.com/kb/20/666.html
http://support.sas.com/kb/34/573.html
I don't have an ETA for a defect fix to both problems nor is there currently an ODS PDF workaround for the problem you described. The recommendation for creating a printable table of contents with a file containing SAS created images and tables is to use ODS RTF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello Tom,
Thanks for following up. I'm sure that I'm preaching to the choir but, from my perspective, rtf is only good if you're creating a small set of tables, listings, and figures. Otherwise, you choose between low resolution graphics or unmanageably large files. It'd be different if you could use SVG graphics in rtf.
In the mean time, I've been known to hard code page numbers for sections of my output (not all of the TLF panels...) into a variation on what is presented in the following paper:
http://www.mwsug.org/proceedings/2012/S1/MWSUG-2012-S125.pdf
Eventually, I'll put in some kind of official comment for the files of Tech Support.
Chuck
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tom,
1. What I was missing was that MS Word will create it's own pdf documents and those pdf documents are reasonably compact. I've always had Acrobat installed and the Acrobat pdf options were easier to find. My version of Acrobat with my version of MS Word loses text off of graphics when converting proprietary vector graphics from Microsoft. Microsoft does fine when converting their own proprietary format.
2. Whether it's SAS, MS Word, or both, the font sizes and line spacings in the pdf documents produced through MS Word are not exactly as specified in SAS.
3. As long as MS Word is part of your organizations production process, using rtf to produce large tables of contents is a workable solution. All magic comes at a price.
Chuck
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Chuck
Thanks for the update. That information is good to know...I'm very much a newbie at trying to create PDF output, so the more tips the better!
Happy New Year,
Tom