<?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: Format certain rows like headers in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133673#M36291</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Cynthia &amp;amp; Ksharp - I did end up going the call define route.&amp;nbsp; In this case, I used a value-check for a column I added to change the formatting based on whether the row is a summary row or not:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute User1;&lt;/P&gt;&lt;P&gt;if User1 in ('Daily Totals','Weekly Totals','Life-to-Date') then&lt;/P&gt;&lt;P&gt; call define(_ROW_,'STYLE','STYLE=header');&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This changes the last 3 rows to have the same formatting as the header.&amp;nbsp; Thanks again for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 May 2013 14:05:42 GMT</pubDate>
    <dc:creator>Tarun</dc:creator>
    <dc:date>2013-05-14T14:05:42Z</dc:date>
    <item>
      <title>Format certain rows like headers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133670#M36288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a newbie, I coded a report from scratch to practice using proc report - here's that code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=WORK.DISP_FMT_ALL nofs;&lt;BR /&gt;columns COUNT_of_ALERT_DISPOSITION_ID SUM_of_HR SUM_of_SU SUM_of_CR SUM_of_FN SUM_of_CL SavedAmount LossAmount;&lt;/P&gt;&lt;P&gt;define COUNT_of_ALERT_DISPOSITION_ID / display style(header)=[cellwidth=60];&lt;BR /&gt;define SUM_of_HR / display style(header)=[cellwidth=50] "HR";&lt;BR /&gt;define SUM_of_SU / display style(header)=[cellwidth=50] "SU";&lt;BR /&gt;define SUM_of_CR / display style(header)=[cellwidth=50] "CR";&lt;BR /&gt;define SUM_of_FN / display style(header)=[cellwidth=50] "FN";&lt;BR /&gt;define SUM_of_CL / display style(header)=[cellwidth=50] "CL";&lt;BR /&gt;define SavedAmount / display style(column)=[cellwidth=100] FORMAT=dollfmt. "Saved";&lt;BR /&gt;define LossAmount / display style(column)=[cellwidth=100] FORMAT=dollfmt. "Loss";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Question: How can I give the last 3 rows the same formatting as the header row?&amp;nbsp; It will help as a visual cue between the detail and total rows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11696iCD214F8C1E703880/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Daily Sample for web.png" title="Daily Sample for web.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 19:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133670#M36288</guid>
      <dc:creator>Tarun</dc:creator>
      <dc:date>2013-05-10T19:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Format certain rows like headers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133671#M36289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean they have the same background ?&lt;/P&gt;&lt;P&gt;if ..&lt;/P&gt;&lt;P&gt;&amp;nbsp; then call define(_row_,......)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 02:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133671#M36289</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-11T02:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Format certain rows like headers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133672#M36290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; KSharp is correct, you could use CALL DEFINE. On the other hand, if you allowed PROC REPORT to do the summarizing, then you could simply put&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=orig_data nowd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(summary)=Header;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;...more code ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and that would cause all the summary lines to be formatted as a header. (see example at the end of the post for this technique)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; But since you "pre-summarized" the data, you are the only person who knows that the last 3 rows are meant to show as summary rows. If you are going to continue to "pre-summarize" the data, then you will need to identify the rows for how you want them styled. I would suggest creating a variable called STYLE_IND and make it D when you want "data" style and H when you want "header" style, then you could have code like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;compute style_ind;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; if style_ind='H' then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_row_,'style','style=Header');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Otherwise, there are ways in PROC REPORT to generate multiple summary lines.&lt;/P&gt;&lt;P&gt;See this paper, &lt;A href="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" title="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf"&gt;http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt; page 7 and 8. She doesn't show the style change in this paper, but the technique below would still work. Here's an example of doing summaries with a Header style automatically. SASHELP.PRDSALE has 1440 observations, but the GROUP usage allows PROC REPORT to collapse and summarize the individual observations in rows at the specified break points. Note the value for COUNT on the final summary line on the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\autosum.html';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=sashelp.prdsale nowd&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(summary)=Header;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title 'Automatic Style for Summary';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column country&amp;nbsp; division&amp;nbsp; product n actual predict;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define country / group;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define division / group;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define product / group;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define n / 'Count';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define actual / sum;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define predict / sum;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; break after division / summarize;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; break after country / summarize;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; rbreak after / summarize;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute after country;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line ' ';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute after;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; country = 'Total';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 14:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133672#M36290</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-05-11T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Format certain rows like headers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133673#M36291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Cynthia &amp;amp; Ksharp - I did end up going the call define route.&amp;nbsp; In this case, I used a value-check for a column I added to change the formatting based on whether the row is a summary row or not:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute User1;&lt;/P&gt;&lt;P&gt;if User1 in ('Daily Totals','Weekly Totals','Life-to-Date') then&lt;/P&gt;&lt;P&gt; call define(_ROW_,'STYLE','STYLE=header');&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This changes the last 3 rows to have the same formatting as the header.&amp;nbsp; Thanks again for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 14:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Format-certain-rows-like-headers/m-p/133673#M36291</guid>
      <dc:creator>Tarun</dc:creator>
      <dc:date>2013-05-14T14:05:42Z</dc:date>
    </item>
  </channel>
</rss>

