BookmarkSubscribeRSS Feed
silasskovsbo
Calcite | Level 5

Hey Everybody.

I would very much love to be able to edit the bookmarks when I do an ODS PDF, but unfortunate not been able to.

I need to change the bookmarks for these programs:

First: Proc mean


Ods pdf file="XXXX";

ods proclabel "VARIABELNAME";

     proc means data=LIBNAME.HAVE;

          class YEAR;

          var VARIABELNAME;

     run;

ods pdf close;


For this program I want to delete the bookmark 'Summary Statistics', do you know how??


Second: Proc freq

Ods pdf file="XXXX";

     proc freq data=LIBNAME.HAVE;

          tables YEAR*(VARIABEL1 VARIABEL2 etc.) / nocol nopercent missing;

     run;

ods pdf close;


For this program I want to delete the bookmark 'Cross-Tabular Freq table' and change the names of the two bookmarks which by default is given the names 'Table YEAR*VARIABEL1' and 'Table YEAR*VARIABEL2' to 'VARIBEL1' and 'VARIABEL2'. Do somebody know how?


Best regards and biggest thank, Silas Skovsbo, Aarhus University


4 REPLIES 4
Ksharp
Super User

I only know how to use proc report to suppress this title , Maybe you need proc template to change the name of template .

Ods pdf file="c:\temp.pdf";

ods proclabel "VARIABELNAME";

title 'variable name : weight';

     proc report data=sashelp.class contents='' nowd;

       column sex weight weight=w_mean;

       define sex/group;

       define weight/sum;

       define w_mean/mean;

     run;

ods pdf close;

Ksharp

Cynthia_sas
SAS Super FREQ

Hi:

While PROC REPORT, PROC PRINT and PROC TABULATE and PROC FREQ all have the CONTENTS= option, PROC MEANS does not have this option.

  Another way to rename and/or delete nodes in your PDF TOC or Bookmark area is to save all your output to an ODS DOCUMENT store and then rearrange, rename or delete nodes and then replay your new version of the output to your destination of choice. When you save your output objects in an ODS DOCUMENT store, you will then use PROC DOCUMENT or the interactive DOCUMENT window to manipulate the saved output objects.

  This paper from 2009 shows the basic concepts

http://support.sas.com/resources/papers/sgf09/318-2009.pdf

  There have been other postings in the forum and there are other user group papers on this topic.

cynthia

silasskovsbo
Calcite | Level 5

Thank you!

I think this proc document can be very helpful for me, haven't never heard about it.

I have tried to read through the link you have sent me and done the coding, but I have met a problem which I cannot solve 😕

at page 13 the REPLAY command is used, but it does not work for me.

I have :

ods html file='replay_new.html'

      style=sasweb;

ods pdf file='replay_new.pdf';

proc document name=work.neworder;

      replay;

run;

quit;

ods _all_ close;

But when I submit the program it shows an error relating to replay; saying "Statement is not valid or it is used out of prober order".

Can you maybe help me what I am doing wrong?

Cynthia_sas
SAS Super FREQ


Hi:

  Hard to say what the issue is. Showing only the code without the actual LOG messages makes it very hard. What is really needed is for someone to look at ALL your log and ALL your code and possibly at your document store, too. This may be a better job for Tech Support to assist with, as it will be quite lengthy to post ALL your code and ALL your log to the forum (and you can't post your document store easily).

  The code on page 13 of my paper produced the screen shot that appears next to the code snippet. This does assume that you successfully created the document store work.neworder. And, that your code has no other syntax errors, missing semi-colons or mismatched quotes. Also relevant is what version of SAS you are running.

 

  I have run versions of the code in that paper in SAS 9.1, 9.2 and 9.3. I just ran the code again in SAS 9.3 and I do not get any syntax errors in the log. So debugging remotely is nearly impossible, since the code works for me. This is the perfect type of problem to bring to Tech Support. To open a track with Tech Support, fill out the form at this link:

http://support.sas.com/ctx/supportform/createForm

  Here's the code I just submitted without any errors (below).

cynthia

title;
footnote;
options nodate nonumber center;
ods listing close;
  
proc sort data=sashelp.prdsale out=prdsale;
  by Country;
run;
        
** 1) Make an ODS Document from PROC TABULATE and;
**    PROC UNIVARIATE. Also make a PDF file to show the original structure.;
ods document name=work.prddoc(write);
ods pdf file='c:\temp\origoutput.pdf';
proc tabulate data=prdsale;
  by Country;
  var predict;
  class prodtype;
  table prodtype all,
        predict*(min mean max);
run;
   
ods select ExtremeObs;
proc univariate data=prdsale;
  by Country;
  var actual;
run;
ods document close;
ods pdf close;
  
ods listing;
  

** 2) Make new document store with new structure;
**    and copy output objects into new folders.;
ods listing;
proc document name=work.neworder(write);
  make CANADA, GERMANY, USA;
run;
   
  dir ^^;
  dir CANADA;
  dir;
  copy \work.prddoc\Tabulate#1\ByGroup1#1\Report#1\Table#1 to ^;
  copy \work.prddoc\Univariate#1\ByGroup1#1\ACTUAL#1\ExtremeObs#1
         to ^ ;
run;
    
  dir ^^;
  dir GERMANY;
  dir;
  copy \work.prddoc\Tabulate#1\ByGroup2#1\Report#1\Table#1  to ^ ;
  copy \work.prddoc\Univariate#1\ByGroup2#1\ACTUAL#1\ExtremeObs#1
         to ^ ;
run;
     
  dir ^^;
  dir USA;
  dir;
  copy \work.prddoc\Tabulate#1\ByGroup3#1\Report#1\Table#1 to ^ ;
  copy \work.prddoc\Univariate#1\ByGroup3#1\ACTUAL#1\ExtremeObs#1
         to ^ ;
run;
quit;
     
**3) Replay the new document store to HTML and PDF.;
ods html file='c:\temp\replay_new.html'
         style=sasweb;
ods pdf file='c:\temp\replay_new.pdf';
proc document name=work.neworder;
   replay;
run;
quit;
  
ods _all_ 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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 4364 views
  • 2 likes
  • 3 in conversation