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

I keep am able to run the exact same program in Base SAS and Enterprise Guide to produce a PDF document with a table of contents. However, in Base SAS I get a printable table of contents, but in Enterprise Guide the final PDF does not contain a printable table of contents. Everything else about the files looks the exact same, except the printable table of contents is in the PDF file generated from Base SAS and not in the PDF generated from Enterprise Guide. 

 

I have been researching this for a couple days and tried several different options and I haven't been able to find a solution. Appreciate any help! 

 

 

 

options nodate;

run;

ods pdf file="filepath.pdf" startpage=no contents=yes uniform;

 

%macro cat (pred,i,tlb,);

ods proclabel="&tlb";

ods trace on;

proc tabulate data=new2 f=10.2 S=[foreground=black background=white just=c font_size=3.75] ;

       class &pred/preloadfmt order=data;

       classlev &pred/s=[foreground=black background=bwh font_size = 3.75];

       table &pred=' ' all={label="All" s=[just=L foreground=black background=bwh font_size=3.75]},(n*f=8. colpctn*f=mypct.)/box=[label="&tlb"   

               style=[background=beige

                      foreground=black font_size = 3.75 width=60%]]  row=float printmiss contents="&tlb";

       keyword n colpctn/style=[background=beige  foreground=black font_size=3.75] ;

       keylabel n="Freq" colpctn="%";

run;

%mend cat;

%cat (dem1,1,var1);

%cat (dem2,2,var2);

%cat (dem3,3,var3);

%cat (dem4,4,var4);

%cat (dem5,5,var5);

ods pdf close;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
It's not the style. It is something related to this Tech Support note: http://support.sas.com/kb/56/041.html -- where the PRINTERPATH needs to be set to PDF BEFORE the code that generates the ODS PDF file.

I was able to replicate the issue in EG with simpler code and once I added
options printerpath=pdf;

The Table of Contents page was generated for PDF.

Cynthia

View solution in original post

6 REPLIES 6
ballardw
Super User

Can you show the entire base program that worked from the ODS PDF statement to the ODS PDF Close?

 

And by any chance is your Enterprise Guide running on a server? The ODS Style might vary from your Base SAS causing an issue.

jessica_hale
Calcite | Level 5

Hi ballardw, 

Is this what you were needing? 

 

ods pdf file="filepath.pdf" startpage=no contents=yes uniform;

 

%macro cat (pred,i,tlb,);

ods proclabel="&tlb";

ods trace on;

proc tabulate data=new2 f=10.2 S=[foreground=black background=white just=c font_size=3.75] ;

       class &pred/preloadfmt order=data;

       classlev &pred/s=[foreground=black background=bwh font_size = 3.75];

       table &pred=' ' all={label="All" s=[just=L foreground=black background=bwh font_size=3.75]},(n*f=8. colpctn*f=mypct.)/box=[label="&tlb"   

               style=[background=beige

                      foreground=black font_size = 3.75 width=60%]]  row=float printmiss contents="&tlb";

       keyword n colpctn/style=[background=beige  foreground=black font_size=3.75] ;

       keylabel n="Freq" colpctn="%";

run;

%mend cat;

%cat (dem1,1,var1);

%cat (dem2,2,var2);

%cat (dem3,3,var3);

%cat (dem4,4,var4);

%cat (dem5,5,var5);

ods pdf close;

ballardw
Super User

This might be an issue with some difference in the way EG uses the default PDF style. Try adding a specific style to the ODS PDF statement such as: Style=Styles.HtmlBlue

This will likely change a number of appearance options but if the TOC prints then we know its a style issue.

 

But again. is your EG running on a server or local?

Cynthia_sas
SAS Super FREQ

Hi:
It's not the style. It is something related to this Tech Support note: http://support.sas.com/kb/56/041.html -- where the PRINTERPATH needs to be set to PDF BEFORE the code that generates the ODS PDF file.

I was able to replicate the issue in EG with simpler code and once I added
options printerpath=pdf;

The Table of Contents page was generated for PDF.

Cynthia

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
  • 6 replies
  • 1538 views
  • 0 likes
  • 3 in conversation