<?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: Output SAS data into various txt files in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242496#M6310</link>
    <description>&lt;P&gt;It is getting to be a bad idea to "lie" to Microsoft applications by naming them one way but not actually being the implied name.&lt;/P&gt;
&lt;P&gt;You are creating a text file. If you want to open it by default in Excel then better would be to use CSV as the extention and DLM=','.&amp;nbsp; Excel doesn't treat space as a delimiter unless you go through the Excel file import wizard.&lt;/P&gt;
&lt;P&gt;Or use Proc export to a CSV file.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2016 22:54:37 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-01-08T22:54:37Z</dc:date>
    <item>
      <title>Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242448#M6305</link>
      <description>&lt;P&gt;I have a SAS data as attached.&amp;nbsp; I will need to input the data into three different txt files, each file contains the the data as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for file: a.dat, it has&lt;/P&gt;
&lt;TABLE width="85"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="85"&gt;50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3053&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;66.3&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for file b.dat, it has&lt;/P&gt;
&lt;TABLE width="85"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="85"&gt;78.1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2.4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;49.2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;455&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, I need to create different files based on the distinct attributes in file_name.&amp;nbsp; Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 19:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242448#M6305</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2016-01-08T19:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242449#M6306</link>
      <description>&lt;P&gt;You talk about input and output. Are you creating text files or reading text files into SAS?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 19:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242449#M6306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T19:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242450#M6307</link>
      <description>&lt;P&gt;sorry for misleading you.&amp;nbsp; I mean output the data into txt file.&amp;nbsp; When outputting, I prefer has no attribute name outputted to the txt file, just purely the data.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 20:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242450#M6307</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2016-01-08T20:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242454#M6308</link>
      <description>Use the filevar option and a put statement within a data step. &lt;BR /&gt;&lt;BR /&gt;There's a lot of examples out there...&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Export-CSV-File/td-p/58898" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Export-CSV-File/td-p/58898&lt;/A&gt;</description>
      <pubDate>Fri, 08 Jan 2016 20:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242454#M6308</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T20:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242480#M6309</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; want_final;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; want4;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'C:\Users\output\'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;|| file_name || &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'.xls'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; OUT &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filevar&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=FILE &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;mod&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; file_name index num;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;I used the above code.&amp;nbsp; However, "&lt;FONT color="#800080" face="Courier New"&gt;.xls" is not added into the file name.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New"&gt;If I pre-add .xls to all file name, I was albe to create all individual .xls files with different names.&amp;nbsp; However, the data of &lt;FONT face="Courier New"&gt;file_name, index, num are all sqeezed into one excel cell, instead of spreading into three cells in each row.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 22:08:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242480#M6309</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2016-01-08T22:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242496#M6310</link>
      <description>&lt;P&gt;It is getting to be a bad idea to "lie" to Microsoft applications by naming them one way but not actually being the implied name.&lt;/P&gt;
&lt;P&gt;You are creating a text file. If you want to open it by default in Excel then better would be to use CSV as the extention and DLM=','.&amp;nbsp; Excel doesn't treat space as a delimiter unless you go through the Excel file import wizard.&lt;/P&gt;
&lt;P&gt;Or use Proc export to a CSV file.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 22:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242496#M6310</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-08T22:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242501#M6311</link>
      <description>&lt;P&gt;Look into ODS TAGSETS.EXCELXP or if you're on SAS 9.4 ODS EXCEL.&lt;/P&gt;
&lt;P&gt;If you want native excel in a plain format, PROC EXPORT also works great.&lt;/P&gt;
&lt;P&gt;If you don't have the appropriate SAS license, look into&amp;nbsp;this macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export" target="_blank"&gt;http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 00:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242501#M6311</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-09T00:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Output SAS data into various txt files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242502#M6312</link>
      <description>&lt;P&gt;Also, the question states text file, what's with adding in Excel? &amp;nbsp;I'm not clear on what you're trying to do...&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 00:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Output-SAS-data-into-various-txt-files/m-p/242502#M6312</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-09T00:04:26Z</dc:date>
    </item>
  </channel>
</rss>

