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

Hi ,

 

I am creating multiple page PDF o/p from proc report with the help of ODS LAYOUT.

 

Title has #byval in it. I want this title and also footer to be printed in each page (during page break).

 

Currently title is printed only in first page. Footer is printed after all the the proc report output is printed in multiple pages.

 

For my requirement, I should use ODS LAYOUT to print the data. And also I cant code the title before ODS LAYOUT as it has #byval in it.

 

Could you please suggest a solution for this?

 

Thanks,

Sampath

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Illustrate your question with some test data and what the output should look like?  Genreally speaking I always output to RTF and then con vert from there, however so long as you output your titles and footnotes to "actual" titles and footnotes - i.e. do use:
options nobodytitle nobodyfoot;

Then the titles and footnotes should appear on everypage.

 

Try to avoid words like "should use", and "I cant", as very rarely in programming are you restricted to use one technology.  For example, you *can* code your titles quite simply with a bit of code and some code generation:

proc sort data=have out=loop nodupkey;
  by thebyvalue;
run;

data _null_;
  set loop;
  call execute('title1 "'||strip(thebyvalue)||'";
                proc report data=have...;
                  where thebyvalue="'||strip(thebyvalue)||'";
                  ...;
                run;');
run;

This will simulate the by group output as it will generate a proc report for each distinct value of thebyvalue.  In this way you can alter your code in any way you want - just change the call execute - maybe conditionally, say for each grou beginning with XYZ then generate this bit of code, for others run a different bit of code etc.  

 

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Illustrate your question with some test data and what the output should look like?  Genreally speaking I always output to RTF and then con vert from there, however so long as you output your titles and footnotes to "actual" titles and footnotes - i.e. do use:
options nobodytitle nobodyfoot;

Then the titles and footnotes should appear on everypage.

 

Try to avoid words like "should use", and "I cant", as very rarely in programming are you restricted to use one technology.  For example, you *can* code your titles quite simply with a bit of code and some code generation:

proc sort data=have out=loop nodupkey;
  by thebyvalue;
run;

data _null_;
  set loop;
  call execute('title1 "'||strip(thebyvalue)||'";
                proc report data=have...;
                  where thebyvalue="'||strip(thebyvalue)||'";
                  ...;
                run;');
run;

This will simulate the by group output as it will generate a proc report for each distinct value of thebyvalue.  In this way you can alter your code in any way you want - just change the call execute - maybe conditionally, say for each grou beginning with XYZ then generate this bit of code, for others run a different bit of code etc.  

 

bmsampath
Obsidian | Level 7

Your reply gave me the idea to fix the issues.

 

Big thanks. !!!

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
  • 2 replies
  • 1112 views
  • 0 likes
  • 2 in conversation