<?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: Export Statistics in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367516#M87504</link>
    <description>&lt;P&gt;1. You can direct the output to Excel 'automatically' (assumes SAS 9.4 TS1M3+)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='mydata.xlsx' style=meadow;

&amp;lt;insert your SAS code here&amp;gt;;


ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. The second option is more manual unfortunately but if you're looking for production ready tables this will get you closer.&lt;/P&gt;
&lt;P&gt;You would capture the tables you want and then proc print or proc report this out to an Excel file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2017 21:48:04 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-06-15T21:48:04Z</dc:date>
    <item>
      <title>Export Statistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367513#M87501</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I'm doing a chisq test or proc logistic, how do I get the results in a data table that can be exported into excel? For example, for the code below, I would like to have the odds ratio, p-value, and confidence intervals in a table for excel export. Same question for proc logistic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA QUESTION;&lt;BR /&gt;INPUT GENDER $ RESPONSE $ COUNT;&lt;BR /&gt;DATALINES;&lt;BR /&gt;WOMEN YES 28&lt;BR /&gt;WOMEN NO 13&lt;BR /&gt;MEN YES 19&lt;BR /&gt;MEN NO 26&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;PROC FREQ DATA=QUESTION ORDER =DATA;&lt;BR /&gt;WEIGHT COUNT;&lt;BR /&gt;TABLES GENDER*RESPONSE / CHISQ RELRISK;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data = question desc;&lt;BR /&gt;class gender;&lt;BR /&gt;model response = gender;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 21:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367513#M87501</guid>
      <dc:creator>Woop122</dc:creator>
      <dc:date>2017-06-15T21:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Export Statistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367516#M87504</link>
      <description>&lt;P&gt;1. You can direct the output to Excel 'automatically' (assumes SAS 9.4 TS1M3+)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='mydata.xlsx' style=meadow;

&amp;lt;insert your SAS code here&amp;gt;;


ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. The second option is more manual unfortunately but if you're looking for production ready tables this will get you closer.&lt;/P&gt;
&lt;P&gt;You would capture the tables you want and then proc print or proc report this out to an Excel file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 21:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367516#M87504</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-15T21:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export Statistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367533#M87516</link>
      <description>&lt;P&gt;Add this to you code and look in the log. You'l lsee all the outputs you can redirect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods trace on;

proc logistic data = question desc;
class gender;
model response = gender;
run;

ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From there you can use ODS OUTPUT statements to capture the bits you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p1fpt3uuow90o3n155hs7bp1mo7f.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p1fpt3uuow90o3n155hs7bp1mo7f.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p0oxrbinw6fjuwn1x23qam6dntyd.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p0oxrbinw6fjuwn1x23qam6dntyd.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 22:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/367533#M87516</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-15T22:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Export Statistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/368389#M87858</link>
      <description>&lt;P&gt;Is there a way to do this without using the ODS excel? I want to export to an already existing excel file and create new tabs, rather than create a whole new file each time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/368389#M87858</guid>
      <dc:creator>Woop122</dc:creator>
      <dc:date>2017-06-19T17:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export Statistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/368396#M87859</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147599"&gt;@Woop122&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Is there a way to do this without using the ODS excel? I want to export to an already existing excel file and create new tabs, rather than create a whole new file each time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not easily but it could be done. You'd have to capture the tables of interest using ODS anyways and then export them manually using PROC EXPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a link on how that can be done:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/368396#M87859</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-19T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export Statistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/368397#M87860</link>
      <description>I guess...the answer is the same as above &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Statistics/m-p/368397#M87860</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-19T17:18:16Z</dc:date>
    </item>
  </channel>
</rss>

