ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
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-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
  • 2 replies
  • 1451 views
  • 0 likes
  • 2 in conversation