BookmarkSubscribeRSS Feed
ZS2
Calcite | Level 5 ZS2
Calcite | Level 5

Is it possible to have two different titles while splitting the data into two pages in proc report? For example, I have a data of 10 variables to present and I am splitting the data into 2 pages using ID variable. I want the title of 1st page as 'ABCD' and the 2nd pages as 'ABCD- Continued'.

1 REPLY 1
ballardw
Super User

It will likely help to share your code.

 

If you are using a BY statement then you can provide options with the by variables. If your ID variable contains the text you want to use you could use the title option "#byval", if not create a format to map the actual value to the desired text.

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

proc format;
value $sexval
'F' = 'First Title'
'M' = '(cont) First Title'
;
run;

/* supress default BY line appearance*/
options nobyline;
title "#byval(sex)";
proc report data=work.class;
   by sex;
   format sex $sexval.;
   columns name age;
run;


/* reset byline*/
options byline;

The Sort is create a data set that can be displayed with BY group in Proc print. The Format will display text different than that of the variable. The Options nobyline means that the default "Sex=value" will not display. The title statement with #Byval means only the value of the by variable appears in that title line. The Format statement in the body of Proc report associates the format with the variable for just that proc report. Then reset the Byline option back to the default.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 610 views
  • 0 likes
  • 2 in conversation