<?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 export in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295281#M61694</link>
    <description>&lt;P&gt;You can concatenate the two tables before exporting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data both;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;nbsp;ae &amp;nbsp;cm;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc export data=both;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OUTFILE= "c:\ae_and_cm.csv" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DBMS=CSV REPLACE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PUTNAMES=Yes;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming both tables have same variables, otherwise it does not make sense to me.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2016 18:52:41 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2016-08-30T18:52:41Z</dc:date>
    <item>
      <title>Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295270#M61689</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to export two sas dataset into one excel with one tab for each dataset. Can some one help me on this. I am using the following code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA= WORK.ae&lt;BR /&gt; OUTFILE= "c\ae.csv" &lt;BR /&gt; DBMS=CSV REPLACE;&lt;BR /&gt; PUTNAMES=Yes;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC EXPORT DATA= WORK.cm&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DBMS=CSV REPLACE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PUTNAMES=Yes;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would need the datasets in the same excel.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also I would like to have collumn label instead of collumn name and bolded to any colur.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 18:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295270#M61689</guid>
      <dc:creator>rakeshvvv</dc:creator>
      <dc:date>2016-08-30T18:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295281#M61694</link>
      <description>&lt;P&gt;You can concatenate the two tables before exporting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data both;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;nbsp;ae &amp;nbsp;cm;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc export data=both;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OUTFILE= "c:\ae_and_cm.csv" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DBMS=CSV REPLACE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PUTNAMES=Yes;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming both tables have same variables, otherwise it does not make sense to me.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 18:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295281#M61694</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-08-30T18:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295301#M61696</link>
      <description>&lt;P&gt;You should add a SHEET statement to specify the name of the Excel sheet (tab) you want the dataset to copy to. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
  input Name $ Age;
  datalines;
Sue 25
Tom 18
;
data y;
  input State $ Capital $;
  datalines;
Ohio Columbus
Georgia Atlanta
;
proc export
	data=x
	file="C:\temp\myExcel.xlsx"
	dbms=xlsx replace;
	sheet="Names";
run;
proc export
	data=y
	file="C:\temp\myExcel.xlsx"
	dbms=xlsx replace;
	sheet="States";
run;
  &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 19:49:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295301#M61696</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2016-08-30T19:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295303#M61698</link>
      <description>&lt;P&gt;CSV files are not Excel files with tabs. Each CSV is a text file. CSV does not support appearnce items such as font, font characteristics or colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might get what you want by printing to a format that does support such things. One method is to print to ODS tagsets.excelxp:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp file="C:\path\file.xls";

proc print data=Work.Ae noobs label;
run;

Proc print data=work.cm noobs label;
run;

ods tagsets.excelxp close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Creates a file, actually in XML format but Excel will open it. By default each proc output should be on a separate tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ODS style in effect will control appearance. You may specify a different style as part of the ODS tagsets.Excelxp statement.&lt;/P&gt;
&lt;P&gt;Proc Print also provides options to adjust some items appearance though getting Excel to honor them isn't always trivial.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 19:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export/m-p/295303#M61698</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-30T19:55:19Z</dc:date>
    </item>
  </channel>
</rss>

