<?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: How to export SAS output into Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652036#M195707</link>
    <description>&lt;P&gt;Proc freq doesn't go as nicely as you'd like to Excel, PROC TABULATE will give you more control.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get any output in Excel, wrap it with ODS EXCEL before and after and it will pipe all the results to Excel. You can control what sheets things go to as well as the sheet names.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='/folders/myfolders/demo.xlsx' style=meadow options (sheet_interval='proc');

proc freq data = sashelp.class;
table age*sex / nopercent norow nocol;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 31 May 2020 00:37:41 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-05-31T00:37:41Z</dc:date>
    <item>
      <title>How to export SAS output into Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652021#M195694</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I ran the following proc freq in SAS and got the SAS output as shown in the attached Word.doc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=test;&lt;BR /&gt;tables (age_group gender)*disease/chisq norow nopercent relrisk;&lt;BR /&gt;Title 'How to export SAS output into Excel';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to get the results directly from SAS to Excel on a table as shown in the attached Excel file.&lt;/P&gt;
&lt;P&gt;Is there a way to modify the proc freq in SAS to get the results as shown in the attached Excel file?&lt;/P&gt;
&lt;P&gt;I have several variables beside age and gender and am I tiered of copy and paste.&lt;/P&gt;
&lt;P&gt;it would be great if all the formating in the table of the attached Excel file can be done in SAS but if it is not possible getting the numbers and name of variables as shown would be great&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all your help will be appreciate it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2020 22:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652021#M195694</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2020-05-30T22:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to export SAS output into Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652032#M195703</link>
      <description>&lt;P&gt;I don't think anyone will open your attached files, however you can put your code where I have indicated&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME out '~/folder/file.xlsx';
ods listing close;
ods excel file=out  options(sheet_name='#byval1');

*your code goes here;
 
ods excel close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 May 2020 23:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652032#M195703</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2020-05-30T23:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to export SAS output into Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652036#M195707</link>
      <description>&lt;P&gt;Proc freq doesn't go as nicely as you'd like to Excel, PROC TABULATE will give you more control.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get any output in Excel, wrap it with ODS EXCEL before and after and it will pipe all the results to Excel. You can control what sheets things go to as well as the sheet names.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='/folders/myfolders/demo.xlsx' style=meadow options (sheet_interval='proc');

proc freq data = sashelp.class;
table age*sex / nopercent norow nocol;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 31 May 2020 00:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652036#M195707</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-31T00:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to export SAS output into Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652104#M195737</link>
      <description>&lt;P&gt;Since you asking to put Chi-square p-values and relative risk information on the same row as other values you aren't going to get proc freq to do that.&lt;/P&gt;
&lt;P&gt;Or without significant work, any other procedure. You would generate the output into two or more data sets, combine some how and then display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 May 2020 18:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652104#M195737</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-31T18:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to export SAS output into Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652105#M195738</link>
      <description>Hi ballardw,&lt;BR /&gt;Thanks for your email.&lt;BR /&gt;Is there a way to get the column percentage in a New column next to The&lt;BR /&gt;frequency in Excel after I get rid of the relative risk and chi-square&lt;BR /&gt;option in proc freq?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 31 May 2020 18:07:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652105#M195738</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2020-05-31T18:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to export SAS output into Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652115#M195742</link>
      <description>I would suggest using the ODS output tables instead that's how they're outputted.&lt;BR /&gt;&lt;BR /&gt;See an example here. Use PROC PRINT to display the final table only.&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/e0903d269d4a71316a4e" target="_blank"&gt;https://gist.github.com/statgeek/e0903d269d4a71316a4e&lt;/A&gt;</description>
      <pubDate>Sun, 31 May 2020 19:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-SAS-output-into-Excel/m-p/652115#M195742</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-31T19:40:16Z</dc:date>
    </item>
  </channel>
</rss>

