<?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 Export Results to Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416063#M102143</link>
    <description>&lt;P&gt;I am a very new SAS university edition user, I have a huge table (20 columns, 4 million rows) and I want to filter the table according to one column (say all the values in column 8 should be equal to 334) and then sort the third column Ascendingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can filter and sort the columns by right click on each column and get the results, but I do not know how can I get the table in excel.&lt;/P&gt;&lt;P&gt;Appreciate your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.query AS&lt;BR /&gt;SELECT SHIPMT_ID , ORIG_STATE , ORIG_MA , ORIG_CFS_AREA , DEST_STATE , DEST_MA , DEST_CFS_AREA , NAICS , QUARTER , SCTG , 'MODE'n , SHIPMT_VALUE , SHIPMT_WGHT , SHIPMT_DIST_GC , SHIPMT_DIST_ROUTED , TEMP_CNTL_YN , EXPORT_YN , EXPORT_CNTRY , HAZMAT , WGT_FACTOR FROM _TEMP0.cfs_2012_pumf WHERE NAICS like '%334%';&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;PROC DATASETS NOLIST NODETAILS;&lt;BR /&gt;CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=WORK.details;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2017 17:33:05 GMT</pubDate>
    <dc:creator>raha_tiny</dc:creator>
    <dc:date>2017-11-24T17:33:05Z</dc:date>
    <item>
      <title>Export Results to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416063#M102143</link>
      <description>&lt;P&gt;I am a very new SAS university edition user, I have a huge table (20 columns, 4 million rows) and I want to filter the table according to one column (say all the values in column 8 should be equal to 334) and then sort the third column Ascendingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can filter and sort the columns by right click on each column and get the results, but I do not know how can I get the table in excel.&lt;/P&gt;&lt;P&gt;Appreciate your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.query AS&lt;BR /&gt;SELECT SHIPMT_ID , ORIG_STATE , ORIG_MA , ORIG_CFS_AREA , DEST_STATE , DEST_MA , DEST_CFS_AREA , NAICS , QUARTER , SCTG , 'MODE'n , SHIPMT_VALUE , SHIPMT_WGHT , SHIPMT_DIST_GC , SHIPMT_DIST_ROUTED , TEMP_CNTL_YN , EXPORT_YN , EXPORT_CNTRY , HAZMAT , WGT_FACTOR FROM _TEMP0.cfs_2012_pumf WHERE NAICS like '%334%';&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;PROC DATASETS NOLIST NODETAILS;&lt;BR /&gt;CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=WORK.details;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 17:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416063#M102143</guid>
      <dc:creator>raha_tiny</dc:creator>
      <dc:date>2017-11-24T17:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Export Results to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416069#M102144</link>
      <description>&lt;P&gt;Try a PROC EXPORT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also right click a Table in Libraries and select Export and export the data to your myfolders.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 18:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416069#M102144</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-24T18:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Export Results to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416070#M102145</link>
      <description>&lt;P&gt;Which dataset do you want in EXCEL?&amp;nbsp; Your codes is creating a dataset named QUERY and then using PROC CONTENTS to create another dataset named DETAILS which you then print.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use ODS EXCEL to direct the PROC PRINT to an XLSX file.&amp;nbsp; So you could create a file named "myfile.xlsx" with something like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='/folders/myfolders/myfile.xlsx';
proc print data=details;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Or you could just copy the data instead of using PROC PRINT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out '/folders/myfolders/myfile.xlsx';
proc copy inlib=work outlib=out;
  select details ;
run;
libname out close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Nov 2017 18:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Results-to-Excel/m-p/416070#M102145</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-24T18:39:30Z</dc:date>
    </item>
  </channel>
</rss>

