<?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 REG:PROC REPORT AND ODS STATEMENT in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21730#M4653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me out for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input dataset &lt;/P&gt;&lt;P&gt;id name no_of_times_repeted &lt;BR /&gt;1 a 3&lt;BR /&gt;1 b 1&lt;BR /&gt;1 c 1&lt;BR /&gt;2 h 1&lt;BR /&gt;3 f 1&lt;BR /&gt;4 a 1&lt;BR /&gt;4 a 1&lt;/P&gt;&lt;P&gt;i am exporting this output to excel file by using ods statement.and i have used proc report also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i want to get the output in excel like &lt;/P&gt;&lt;P&gt;1 a 3&lt;BR /&gt;1 b 1&lt;BR /&gt;1 c 1&lt;BR /&gt;-----------&lt;BR /&gt;no of visits -5(sum of no_of_times_repeted)&lt;BR /&gt;-----------&lt;BR /&gt;2 h 1&lt;BR /&gt;---------&lt;BR /&gt;no of visits -1(sum of no_of_times_repeted)&lt;BR /&gt;---------&lt;BR /&gt;3 f 1&lt;BR /&gt;---------&lt;BR /&gt;no of visits -1(sum of no_of_times_repeted)&lt;BR /&gt;---------&lt;BR /&gt;4 a 1&lt;BR /&gt;4 a 1&lt;BR /&gt;--------&lt;BR /&gt;no of visits -2(sum of no_of_times_repeted)&lt;BR /&gt;--------&lt;/P&gt;&lt;P&gt;Note: i have to get output by using proc report and ods statement.&lt;BR /&gt;IN LINE Statement i want to get no of visits -2(sum of no_of_times_repeted)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Mar 2012 05:08:14 GMT</pubDate>
    <dc:creator>sasemp999</dc:creator>
    <dc:date>2012-03-05T05:08:14Z</dc:date>
    <item>
      <title>REG:PROC REPORT AND ODS STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21730#M4653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me out for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input dataset &lt;/P&gt;&lt;P&gt;id name no_of_times_repeted &lt;BR /&gt;1 a 3&lt;BR /&gt;1 b 1&lt;BR /&gt;1 c 1&lt;BR /&gt;2 h 1&lt;BR /&gt;3 f 1&lt;BR /&gt;4 a 1&lt;BR /&gt;4 a 1&lt;/P&gt;&lt;P&gt;i am exporting this output to excel file by using ods statement.and i have used proc report also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i want to get the output in excel like &lt;/P&gt;&lt;P&gt;1 a 3&lt;BR /&gt;1 b 1&lt;BR /&gt;1 c 1&lt;BR /&gt;-----------&lt;BR /&gt;no of visits -5(sum of no_of_times_repeted)&lt;BR /&gt;-----------&lt;BR /&gt;2 h 1&lt;BR /&gt;---------&lt;BR /&gt;no of visits -1(sum of no_of_times_repeted)&lt;BR /&gt;---------&lt;BR /&gt;3 f 1&lt;BR /&gt;---------&lt;BR /&gt;no of visits -1(sum of no_of_times_repeted)&lt;BR /&gt;---------&lt;BR /&gt;4 a 1&lt;BR /&gt;4 a 1&lt;BR /&gt;--------&lt;BR /&gt;no of visits -2(sum of no_of_times_repeted)&lt;BR /&gt;--------&lt;/P&gt;&lt;P&gt;Note: i have to get output by using proc report and ods statement.&lt;BR /&gt;IN LINE Statement i want to get no of visits -2(sum of no_of_times_repeted)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 05:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21730#M4653</guid>
      <dc:creator>sasemp999</dc:creator>
      <dc:date>2012-03-05T05:08:14Z</dc:date>
    </item>
    <item>
      <title>REG:PROC REPORT AND ODS STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21731#M4654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data x;
input id name $ no_of_times_repeted ;
cards;
1 a 3
1 b 1
1 c 1
2 h 1
3 f 1
4 a 1
4 a 1
;
run;
ods tagsets.excelxp file='c:\x.xls' style=sasweb;
proc report data=x nowd;
column id name&amp;nbsp; no_of_times_repeted ;
define id/order;
compute before id;
 sum=no_of_times_repeted.sum;
endcomp;
compute after id;
line '------------------';
line 'sum:' sum best8.;
line '-----------------';
endcomp;
run;
ods tagsets.excelxp close;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 10:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21731#M4654</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-05T10:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: REG:PROC REPORT AND ODS STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21732#M4655</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 has shown you one approach with the LINE statement. Depending on your ODS DESTINATION (ODS CSV, ODS HTML or ODS TAGSETS.EXCELXP), you may or may not like the look of the dashes when your output file from ODS is rendered in Excel. I don't understand why you even need the LINE statement, when the BREAK AFTER capability combined with the COMPUTE statement will give you what you describe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I wonder whether you are also asking for the value of ID and the value of NAME to be displayed on each report row. If you have a usage of ORDER for ID, then the ID will only appear on the first row for the group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Alternate code is shown below, which produced the attached output (see screenshot).&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;data example;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; length id $20 name $20;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; infile datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; input id $ name $ no_of_times_repeated ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; ** make a copy of ID for ordering;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; order_id = id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; id = right(id);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;return;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1 a 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1 b 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1 c 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;2 h 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;3 f 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;4 a 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;4 a 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&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;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods csv file='c:\temp\report_comma_dlm.csv';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k file='c:\temp\report_html.xls' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp file='c:\temp\report.xml' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=example nowd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column order_id id name&amp;nbsp; no_of_times_repeated ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define order_id / order noprint;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define id/display;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define name / display;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define no_of_times_repeated / sum;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; break after order_id / summarize;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if upcase(_break_) = 'ORDER_ID' 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;&amp;nbsp;&amp;nbsp; id='No of Visits';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute after order_id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line ' ';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11217iA04A72093EDF7111/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="no_of_visits.jpg" title="no_of_visits.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 20:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REG-PROC-REPORT-AND-ODS-STATEMENT/m-p/21732#M4655</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-03-05T20:02:48Z</dc:date>
    </item>
  </channel>
</rss>

