BookmarkSubscribeRSS Feed
SusanParker
Calcite | Level 5
I have used the information in the posting "Multiple children in PDF TOC" to get as far as I can.

I have a proc report with a set of by variables and its going to pdf. I want a bookmark for each combination of my 3 by variables. I have used proc document to modify the bookmarks, but I still end up with an extra bookmark for each proc report. Its at the same level as my modified book mark that contains the by variable values and its called "Table 1" in each instance. I'm happy to send my output pdf to anyone who wants to see what I mean if I haven't been clear.

I dummied up a similar program using sashelp.class.

options leftmargin=0.75in rightmargin=0.75in topmargin=0.5in bottommargin=0.5in
orientation=landscape;
ods escapechar='^';
OPTIONS NoByLine nonumber nodate MISSING='-';

proc sort data=sashelp.class out=class;
by sex age name;
run;

data _null_;
set class end=nomore;
by sex age name;

retain counter 0.;
counter = counter + 1;
call symput('label'||strip(put(counter,best.)),'Sex=' || strip(sex) || ', Age=' || strip(put(age,best.)) || ', Name=' || strip(name));

if nomore then call symput('subjcount',strip(put(counter,best.)));
run;

ods listing close;
ods document name=test2 (write);
proc report data=class nowd headline spacing=1 center split='!' missing contents=' ' spanrows;
by sex age name;
column height weight;

TITLE2 "Sex = #ByVal1 Age = #ByVal2 Name = #ByVal3";

define height / display 'Height!(in)' style=[just=dec];
define weight / display 'Weight!(lb)' style=[just=dec];
run;

ods document close;

** just so I could look at them;
proc document name=test2;
ods output properties=PROPERTIES;
list/levels=all;
run;
ods output close;
quit;

** create a new ODS document with 1 high level node and many children;
ods listing;
proc document name=neworder2(write);

make onetop;
dir onetop;
setlabel \onetop#1 'Listing of Sex, Age, and Name';

%macro it;
%do i = 1 %to &subjcount;
move \work.test2\Report#1\ByGroup&i#1\Report#1\Report#1 to ^;
setlabel \onetop#1\Report#&i "&&label&i";
%end;
%mend it;
%it

run;
quit;

*again so I could see what I did;
proc document name=neworder2;
ods output properties=PROPERTIES2;
list/levels=all;
run;
ods output close;
quit;

ods pdf file='testx.pdf' style=pdfstyle pdftoc=2;
proc document name=work.neworder2;
replay;
run;
quit;
ods pdf close;

Thanks in advance!

Sue
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi
I am not able to run your code right now (in airport), but there is a Tech Support on the existence of this extra node and how to get rid of it...what I do not remember is whether you can touch that node with ODS Document or whether you have to get rid of it in Proc Report in a contents= option on compute before.

Searching on support.s.sas.com on the search string
proc report extra table1 contents
...should find the note.

Cynthia
SusanParker
Calcite | Level 5
Thanks! Searching support.sas.com didn't bring it up, but googling did.

For others, its Problem Note 31278: Table 1 node generated by PROC REPORT

I'll report back if it doesn't do the trick.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 953 views
  • 0 likes
  • 2 in conversation