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

Hi all

 

I have set up a PDF output page through ODS. I have 24 pages.

 

Each page has 3 separate sections, with two proc reports and one chart.

 

These are independant procedures, but on the same page which is what i want.

 

When I create PDF with bookmarks, it naturally gives me bookmarks for all three, however I only want one bookmark as they are on the same page.

 

I tried using the ODS Proc Label="" for two of the three programs, and about anything i could find, but nothing seems to work.

 

Appreciate any advice.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi, Edward
I like to think of ODS DOCUMENT as a "freezer".

You do all the work and the chopping on Saturday and you chop and freeze green peppers and onions. By way of comparison with ODS DOCUMENT, let's say you run your "basic program", create all the outputs one time and store your ODS OUTPUT objects in the document store on Saturday.

Then, on Tuesday, you're making pizza, so you use the frozen green peppers and the frozen onions on the pizza. But, before you make the pizza on Tuesday, you boss calls and asks for the reports in HTML format -- so you run an ODS DOCUMENT REPLAY and send the "frozen" output objects to ODS HTML.

Then on Thursday, you decide to make tacos, so you cook the frozen green peppers and the frozen onions in the taco sauce. But before you finish the tacos, your boss sends you a text message and now he wants the same report from Tuesday, but in RTF format. So, you run to your computer, do an ODS DOCUMENT REPLAY and send the frozen output objects from the ODS DOCUMENT store to ODS RTF.

Changing bookmarks in a DOCUMENT store is how you would go from 3 bookmarks to 1 for each "group" on a page.

I showed this basic process and the equivalent point and click method and the code method in this paper:
https://support.sas.com/resources/papers/sgf09/318-2009.pdf

Hope this gets you pointed in the right direction. I am not sure where the ODS LAYOUT pieces would come into play -- my guess is that you would NOT use ODS LAYOUT when you capture the output objects, but that you MIGHT use ODS LAYOUT when you replay the output objects. ODS LAYOUT did not exist in 2009 when I wrote my paper. My recommendation is that you get your bookmark changing logic working and then work with Tech Support on the ODS LAYOUT question with ODS DOCUMENT.

cynthia

View solution in original post

6 REPLIES 6
QingLiu
Calcite | Level 5
I met the same issue as you in the past. But I solved my problem by using ODS Document statment. and it's a powerful tool. Please seen attachement as a example. sample statement would like: proc document name =profiles.test(write); make ^\test1; setlabel ^\test1 'Patient Profiles'; run; quit;
EdwardB
Fluorite | Level 6

Hi QingLiu

 

Thanks for your reply. I have researched ODS document on the SAS dictionary, but I unsure of this works.

 

Does the Proc Document procedure go after the PDF creation procedure?

 

I have put a dummy data set below and PDF output if this helps on where I should use the ods document process.

 

Appreciated.

 

https://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002231478.htm#a002...

 

 

/**Example Dataset**/
options nodate; 
   data BPressure;
      length PatientID $2;
      input PatientID $ Systolic Diastolic @@;
      datalines;
   CK 120 50  SS 96  60 FR 100 70
   CP 120 75  BL 140 90 ES 120 70
   CP 165 110 JI 110 40 MC 119 66
   FC 125 76  RW 133 60 KD 108 54
   DS 110 50  JW 130 80 BH 120 65
   JW 134 80  SB 118 76 NS 122 78
   GS 122 70  AB 122 78 EC 112 62
   HH 122 82
   ;
   run;
 
/**PDF Output**/
 
Options nocenter nodate nonumber orientation=portrait papersize=a4 BOTTOMMARGIN=.001;
  
ods pdf file="/folders/myfolders/reports/Diastolic.pdf" text='Diastolic Blood Pressure' startpage=yes;
 
 proc univariate data=BPressure;
      var Systolic Diastolic;
   run;
  
ODS LAYOUT END;
ODS PDF CLOSE;
TITLE;
 

/**Proc Document?**/
proc document name = Diastolic(write);
make ^\test1;
setlabel ^\test1 'Patient Profiles';
run;
quit;
Cynthia_sas
SAS Super FREQ
Hi, Edward
I like to think of ODS DOCUMENT as a "freezer".

You do all the work and the chopping on Saturday and you chop and freeze green peppers and onions. By way of comparison with ODS DOCUMENT, let's say you run your "basic program", create all the outputs one time and store your ODS OUTPUT objects in the document store on Saturday.

Then, on Tuesday, you're making pizza, so you use the frozen green peppers and the frozen onions on the pizza. But, before you make the pizza on Tuesday, you boss calls and asks for the reports in HTML format -- so you run an ODS DOCUMENT REPLAY and send the "frozen" output objects to ODS HTML.

Then on Thursday, you decide to make tacos, so you cook the frozen green peppers and the frozen onions in the taco sauce. But before you finish the tacos, your boss sends you a text message and now he wants the same report from Tuesday, but in RTF format. So, you run to your computer, do an ODS DOCUMENT REPLAY and send the frozen output objects from the ODS DOCUMENT store to ODS RTF.

Changing bookmarks in a DOCUMENT store is how you would go from 3 bookmarks to 1 for each "group" on a page.

I showed this basic process and the equivalent point and click method and the code method in this paper:
https://support.sas.com/resources/papers/sgf09/318-2009.pdf

Hope this gets you pointed in the right direction. I am not sure where the ODS LAYOUT pieces would come into play -- my guess is that you would NOT use ODS LAYOUT when you capture the output objects, but that you MIGHT use ODS LAYOUT when you replay the output objects. ODS LAYOUT did not exist in 2009 when I wrote my paper. My recommendation is that you get your bookmark changing logic working and then work with Tech Support on the ODS LAYOUT question with ODS DOCUMENT.

cynthia

EdwardB
Fluorite | Level 6

Hi Cynthia

 

Thankyou! your paper made sense out of it for me, well done.

 

This is going to be a powerful function to learn which i am looking forward to.

 

The only issue I am having now when using ODS document is with the images I had on my PDF, which i created through the ODS PDF text statements, which doesnt work in this way anymore through ODS document processt. Not sure if your aware of how to correct this, otherwise I will seek out tech support.

 

This is the code for my image in the previous PDF statement which worked;

ODS PDF TEXT ="^S={preimage='/folders/myfolders/reports/banner.bmp'}";

 

I tried ODS PDF TEXT ="^S={preimage='/folders/myfolders/reports/banner.bmp'}"; with no luck.

 

Again thanks so much, really enjoyed your paper :>)

Cynthia_sas
SAS Super FREQ
Hi, Edward, I think (but you'll have to check with Tech Support) that the only images stored are images created with SAS/GRAPH or ODS GRAPHICS. So I am not sure your banner.bmp would get put into the Document store. And the other thing I never tested is whether ODS TEXT strings get stored in the Document store (they might not be).

My guess is that you would put the "big things" like the output from your procedures into the document store at creation or "freezing" time and then you do all the "cosmetic" things -- ODS TEXT and banner images at replay time -- but really, I think Tech Support is your best bet for help with this.

cynthia
EdwardB
Fluorite | Level 6

Hi Cynthia

 

Your right as usual! I added the image text to the replay statement and it works in there, so yes that appears to be where the cosmetics are done.

 

Cannot thank you enough :>)

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
  • 3649 views
  • 1 like
  • 3 in conversation