BookmarkSubscribeRSS Feed
xxformat_com
Barite | Level 11

Hi,

I have to question with respect to the table of contens in PDF files when using the table of contents options.

 

First question

 

%let xxdemo = ...;

proc format;
    value $sex 'M'='Male'
               'F'='Female';
run;              

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

data class;
    set class;
    dummy=0;
    format sex $sex.;
run;

options nobyline;

ods pdf file ="&xxdemo./reporting/test.pdf" startpage=no contents;

ods proclabel 'Level 1';

title '#byval(sex)';

proc report data=class  contents='Level 2';
    by descending sex;
    column dummy sex age;
    define dummy  / order noprint;
    define sex    / display;
    define age    / display;   
    break before dummy / contents = 'Level 3' page;
run;


ods pdf close;

q1.JPG

 

In the output, we can see that the table of contents include Sex=Male and Sex=Female. How to replace it  with a value like the one in the title i.e. #byval1?

 

Question 2

 

%let xxdemo = ...

proc format;
    value $sex 'M'='Male'
               'F'='Female';
run;              

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

data class;
    set class;
    dummy=0;
    format sex $sex.;
run;

options nobyline;

ods pdf file ="&xxdemo./reporting/test.pdf" startpage=no contents;

ods proclabel ' ';

title '#byval(sex)';

proc report data=class  contents=' ';
    by descending sex;
    column dummy sex age;
    define dummy  / order noprint;
    define sex    / display;
    define age    / display;   
    break before dummy / contents = ' ' page;
run;


ods pdf close;

q2.JPG

In this example, the text of levels 1, 2 and 3 are removed. but we still get the lines in the table of contents created with the contents option. How to remove them?

 

Thanks

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 0 replies
  • 787 views
  • 0 likes
  • 1 in conversation