<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: re: #byval in header in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/479674#M21305</link>
    <description>&lt;P&gt;How would you do this if you wanted to see the month name?&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 19:49:09 GMT</pubDate>
    <dc:creator>abcrandy</dc:creator>
    <dc:date>2018-07-19T19:49:09Z</dc:date>
    <item>
      <title>re: #byval in header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/316108#M17429</link>
      <description>&lt;P&gt;Hi....is it possible to use the #byval feature in the header when creating an rtf file? The following code works but instead of having a title I would like the title as a header on each table....Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods listing close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options nodate;&lt;/P&gt;
&lt;P&gt;title;&lt;/P&gt;
&lt;P&gt;options nobyline;&lt;/P&gt;
&lt;P&gt;ods rtf FILE="%sysfunc(pathname(project))\report.rtf";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title "#byval(monthnum) &amp;amp;year";&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;report&lt;/STRONG&gt; data=summary center nowd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; style(report)=[font=(Arial, &lt;STRONG&gt;8&lt;/STRONG&gt;pt)]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; style(column)=[font=(Arial, &lt;STRONG&gt;8&lt;/STRONG&gt;pt) cellheight=&lt;STRONG&gt;1&lt;/STRONG&gt;in cellwidth=&lt;STRONG&gt;1&lt;/STRONG&gt;in]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; style(header)=[font=(Arial, &lt;STRONG&gt;10&lt;/STRONG&gt;pt) font_weight=bold]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; split='*';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by monthnum;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; format monthnum nlstrmon.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; column ((weeknum Sun Mon Tue Wed Thu Fri Sat));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; define weeknum / group order=internal noprint;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; compute Sun;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_col_, "style","style={background=lightgrey}");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute Sat;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_col_, "style","style={background=lightgrey}");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;ods rtf close;&lt;/P&gt;
&lt;P&gt;options byline;&lt;/P&gt;
&lt;P&gt;title;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 23:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/316108#M17429</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2016-12-01T23:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: re: #byval in header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/316118#M17431</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You can get something like this, using PROC REPORT and the PAGE option -- use it with or without BY variables -- if you don't want the title, then take out the BY statement and take out the TITLE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; But you will need to understand the COMPUTE BEFORE and using GROUP or ORDER variables as "page" variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6188i87E09804C6E6824B/image-size/original?v=v2&amp;amp;px=-1" alt="use_compute_before.png" title="use_compute_before.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with this code using SASHELP.PRDSALE (you'll have to adapt the code to your data):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=sashelp.prdsale nway n sum;
  class year quarter country region;
  var actual;
  output out=work.mnout n=cnt sum=actsum mean=actmean;
run;

proc print data=mnout;
run;
ods _all_ close;

proc sort data=mnout;
by year quarter country region;
run;
  
options nobyline;
    
ods rtf FILE="c:\temp\use_page_report.rtf";

title "Title: #byval1 and Qtr #byval2";

proc report data=mnout center nowd
        style(report)=[font=(Arial, 8pt)]
        style(column)=[font=(Arial, 8pt)]
		style(lines)=Header{font=(Arial, 10pt) font_weight=bold}
        style(header)=[font=(Arial, 10pt) font_weight=bold]
        split='*';
   by year quarter;
   column (year quarter country region cnt actsum actmean);
   define year / group page noprint;
   define quarter / group page noprint;
   define country / order;
   define region / order;
   define cnt / 'Count';
   define actsum / sum;
   define actmean / 'Mean';
   break before year / page;
   compute before _page_;
     pgstr = catx(' ','Year:',year,'--', 'Quarter',quarter);
	 line pgstr $varying100.;
   endcomp;
run;

ods rtf close;
options byline;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 23:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/316118#M17431</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-12-01T23:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: re: #byval in header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/316137#M17432</link>
      <description>&lt;P&gt;It should be easier than this. Please support the Ballot idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Support-BYVARn-and-BYVALn-in-more-places/idi-p/219710" target="_blank"&gt;https://communities.sas.com/t5/SASware-Ballot-Ideas/Support-BYVARn-and-BYVALn-in-more-places/idi-p/219710&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 04:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/316137#M17432</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-12-02T04:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: re: #byval in header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/479674#M21305</link>
      <description>&lt;P&gt;How would you do this if you wanted to see the month name?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 19:49:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/479674#M21305</guid>
      <dc:creator>abcrandy</dc:creator>
      <dc:date>2018-07-19T19:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: re: #byval in header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/479681#M21306</link>
      <description>Hi:&lt;BR /&gt;  Well, this example did not have MONTH, since it used YEAR and QUARTER. But I'd probably use a date with a SAS format or a format like MONNAME if all I had was a month value of 1-12.&lt;BR /&gt;Cynthia&lt;BR /&gt;&lt;BR /&gt;ps...next time, start a new post and refer back to this 2 year old posting. Nobody can see the older tracks.&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Jul 2018 20:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/m-p/479681#M21306</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-07-19T20:01:27Z</dc:date>
    </item>
  </channel>
</rss>

