<?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: Proc report format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491424#M128865</link>
    <description>Thankyou for your reply. You are correct I can still have a ods output file if i specify the path correctly.</description>
    <pubDate>Thu, 30 Aug 2018 20:47:12 GMT</pubDate>
    <dc:creator>75063</dc:creator>
    <dc:date>2018-08-30T20:47:12Z</dc:date>
    <item>
      <title>Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491360#M128836</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS on demand for academics so I do not have access to ods output function.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two proc report outputs from two data frames.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the data frames are "test" and "test1"-&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;input brand $ Freq Freq1 COUNT;&lt;BR /&gt;datalines;&lt;BR /&gt;A 2 3 8&lt;BR /&gt;B 3 5 4&lt;BR /&gt;C 4 6 2&lt;BR /&gt;D 5 1 1&lt;BR /&gt;E 6 5 8&lt;BR /&gt;F 7 7 9&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data test1;&lt;BR /&gt;input cars $ Freq Freq1 COUNT;&lt;BR /&gt;datalines;&lt;BR /&gt;g 4 1 9&lt;BR /&gt;h 6 0 5&lt;BR /&gt;i 8 1 6&lt;BR /&gt;j 1 6 8&lt;BR /&gt;k 7 4 4&lt;BR /&gt;l 6 5 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two proc reports that I get from the above data frames are as below -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=test nowd out=abs&lt;BR /&gt;style(summary)=Header;&lt;BR /&gt;title 'test';&lt;BR /&gt;column brand&lt;BR /&gt;('Enrollment' Freq Freq1 COUNT);&lt;BR /&gt;define brand / group "Enrollment by Residency";&lt;BR /&gt;rbreak after / summarize;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc report data=test1 nowd out=abs&lt;BR /&gt;style(summary)=Header;&lt;BR /&gt;title 'test1';&lt;BR /&gt;column cars&lt;BR /&gt;('Enrollment' Freq Freq1 COUNT);&lt;BR /&gt;define cars / group "Enrollment by type";&lt;BR /&gt;rbreak after / summarize ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output of these reports are attached as "Output" . However, my desired output has sub headings in between the observations as in the attachment "Desired output"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for some guidance on changing my "Output" to the "Desired output".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 17:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491360#M128836</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-08-30T17:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491386#M128848</link>
      <description>&lt;P&gt;It looks like you will need a "Compute After" but I'm not sure exactly how to implement that as i don't know how your car and brand groups are defined.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/How-to-Label-totals-and-subtotals-in-PROC-Report/td-p/430403" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/How-to-Label-totals-and-subtotals-in-PROC-Report/td-p/430403&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check page 5 of this PDF where they use a format statement to define the groups;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.excursive.net/sas/ProcReportPaper.pdf" target="_blank"&gt;http://www.excursive.net/sas/ProcReportPaper.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $Continent
'U.S.A.', 'CANADA'= 'NA'
'GERMANY' = 'EU';
run;

proc report data=smallprod
nowindows missing headline;
column country region predict actual;
define country / group format=$continent. width=7;
define region / group;
run;

prints:
Country Region PREDICT ACTUAL
-------------------------------------------
EU EAST 1,810.00 1,592.00
WEST 2,283.00 2,224.00
NA EAST 3,369.00 3,979.00
WEST 2,489.00 3,388.00&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Probably need to do something like that for your brand/car groups and then use that format in "Define" and "Compute After".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, kind of lazy. marginally helpful response, but maybe it will be what you need.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 19:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491386#M128848</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2018-08-30T19:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491411#M128857</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am using SAS on demand for academics so I do not have access to ods output function.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Are you sure about that? Is there some feature you tried that didn't work?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You have to specify the file paths correctly and you can download the files afterward but it works perfectly fine AFAIK. See the image below, I've XXXX out my name from the file path.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_AoD.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22912iE29D22FEFAEF5B95/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_AoD.JPG" alt="delete_AoD.JPG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 20:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491411#M128857</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-30T20:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491424#M128865</link>
      <description>Thankyou for your reply. You are correct I can still have a ods output file if i specify the path correctly.</description>
      <pubDate>Thu, 30 Aug 2018 20:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491424#M128865</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-08-30T20:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491431#M128869</link>
      <description>Thank you for your reply. Here all the observations in cars and brand are independent to each other as they have been concatenated from various data sets. So we are unable to use a summary or grand total.</description>
      <pubDate>Thu, 30 Aug 2018 21:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491431#M128869</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-08-30T21:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491443#M128880</link>
      <description>&lt;P&gt;I think you should consider combining your data and try PROC TABULATE instead.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148556"&gt;@75063&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for your reply. Here all the observations in cars and brand are independent to each other as they have been concatenated from various data sets. So we are unable to use a summary or grand total.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 21:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491443#M128880</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-30T21:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491484#M128902</link>
      <description>Thank you for your suggestion.&lt;BR /&gt;Can you guide me to a example of adding a subheading by Proc TABULATE. (Similar to the one I would like to get as output)</description>
      <pubDate>Fri, 31 Aug 2018 01:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491484#M128902</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-08-31T01:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491506#M128913</link>
      <description>&lt;P&gt;Where do Sub1 and Sub2 come from? It's not shown in your samples. For the code to be dynamic and account for that the logic has to flow from the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
infile cards truncover;
input GROUP_VAR $ brand $ Freq Freq1 COUNT;
datalines;      
SUB1 A 2 3 8
SUB1 B 3 5 4
SUB1 C 4 6 2
SUB2 D 5 1 1
SUB2 E 6 5 8
SUB2 F 7 7 9
;
run;

proc tabulate data=test;
class group_var brand / order=data missing;
var freq freq1 count;
table group_var=''*brand='', freq*sum='' freq1*sum='' count*sum=''/misstext='';
run;

proc report nowd data=test;
   col group_var brand freq freq1 count;
   define group_var / group noprint format=$8.;
   define brand/order;
   define freq/ sum;
   define freq1 / sum;
   define count / sum;
  break before group_var  / skip;
    compute before group_var/
      style={cellheight=8pt font_size=12pt just=left};
      line group_var $100.;
  endcomp;
run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 04:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-format/m-p/491506#M128913</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-31T04:20:25Z</dc:date>
    </item>
  </channel>
</rss>

