The SAS Output Delivery System and reporting techniques

Is there any option to print the title(has #BYVAL) and footer in each page in ODS LAYOUT

Accepted Solution Solved
Reply
Contributor
Posts: 32
Accepted Solution

Is there any option to print the title(has #BYVAL) and footer in each page in ODS LAYOUT

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

 

 

 


Accepted Solutions
Solution
‎12-28-2016 02:19 PM
Esteemed Advisor
Esteemed Advisor
Posts: 6,670

Re: Is there any option to print the title(has #BYVAL) and footer in each page in ODS LAYOUT

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


All Replies
Solution
‎12-28-2016 02:19 PM
Esteemed Advisor
Esteemed Advisor
Posts: 6,670

Re: Is there any option to print the title(has #BYVAL) and footer in each page in ODS LAYOUT

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.  

 

Contributor
Posts: 32

Re: Is there any option to print the title(has #BYVAL) and footer in each page in ODS LAYOUT

Your reply gave me the idea to fix the issues.

 

Big thanks. !!!

Post a Question
Discussion Stats
  • 2 replies
  • 200 views
  • 0 likes
  • 2 in conversation