<?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 from SAS to TXT file and keep structrure in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459597#M70258</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to export a sas data set to txt file.&lt;/P&gt;&lt;P&gt;proc export data=sashelp.class outfile="/usr/local/SAS/xxxlexample.txt" &amp;nbsp; &amp;nbsp; &amp;nbsp;dbms=tab replace;&lt;BR /&gt;putnames=no;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I open the &amp;nbsp;txt file i see that all data is in one row.&lt;/P&gt;&lt;P&gt;I want to export the data and keep same table structure as in original data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ronekd&lt;/P&gt;</description>
    <pubDate>Thu, 03 May 2018 10:34:27 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2018-05-03T10:34:27Z</dc:date>
    <item>
      <title>Export from SAS to TXT file and keep structrure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459597#M70258</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to export a sas data set to txt file.&lt;/P&gt;&lt;P&gt;proc export data=sashelp.class outfile="/usr/local/SAS/xxxlexample.txt" &amp;nbsp; &amp;nbsp; &amp;nbsp;dbms=tab replace;&lt;BR /&gt;putnames=no;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I open the &amp;nbsp;txt file i see that all data is in one row.&lt;/P&gt;&lt;P&gt;I want to export the data and keep same table structure as in original data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ronekd&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 10:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459597#M70258</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-05-03T10:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Export from SAS to TXT file and keep structrure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459600#M70259</link>
      <description>&lt;P&gt;Define "&lt;SPAN&gt;When I open the &amp;nbsp;txt file i see that all data is in one row." please.&amp;nbsp; Are you exporting the file on a Unix system and opening on a Windows system?&amp;nbsp; This is the most common cause of confusion as Unix and Windows line endings are different.&amp;nbsp; Notepad cannot cope with that, but Notepad++ and Textpad for example can,&amp;nbsp; and the data is importable in either by use of the termstr modifier.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Otherwise please clarify how your getting the file, and what your opening it with.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 10:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459600#M70259</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-03T10:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export from SAS to TXT file and keep structrure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459623#M70260</link>
      <description>&lt;P&gt;One row means that all data is in one raw&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;lets say we have 2 observations with 2&amp;nbsp;fields&lt;/P&gt;&lt;P&gt;Normal table structure is:&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;10&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; 5 &amp;nbsp;&lt;/P&gt;&lt;P&gt;And I get&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp;10 &amp;nbsp;2 &amp;nbsp; 5&lt;/SPAN&gt;&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>Thu, 03 May 2018 12:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459623#M70260</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-05-03T12:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Export from SAS to TXT file and keep structrure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459624#M70261</link>
      <description>&lt;P&gt;I&amp;nbsp;&lt;STRONG&gt;know&lt;/STRONG&gt; what you mean.&amp;nbsp; What you don't know is that the raw ascii underneath that includes one or two special characters called LF (linefeed) and CR (carriage return) which tells the program when yo break the line.&amp;nbsp; Unix only uses LF, windows uses LF+CR.&amp;nbsp; If you transfer your file from Unix to Windows, and use a program which cannot understand this such as notepad, then the program sees LF and thinks, thats not a line ending I will ignore it.&lt;/P&gt;
&lt;P&gt;If you want further help, tell us how your exporting - which os as wel, which os your opening on, how your transferring, and what application to open it.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 12:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459624#M70261</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-03T12:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Export from SAS to TXT file and keep structrure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459716#M70263</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am trying to export a sas data set to txt file.&lt;/P&gt;
&lt;P&gt;proc export data=sashelp.class outfile="/usr/local/SAS/xxxlexample.txt" &amp;nbsp; &amp;nbsp; &amp;nbsp;dbms=tab replace;&lt;BR /&gt;putnames=no;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I open the &amp;nbsp;txt file i see that all data is in one row.&lt;/P&gt;
&lt;P&gt;I want to export the data and keep same table structure as in original data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Ronekd&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is likely an artifact of how you're seeing the data, but it should be fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure your text editor has word wrap turned on or try and open it with Excel to see if it's properly formatted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.cs.toronto.edu/~krueger/csc209h/tut/line-endings.html" target="_self"&gt;Otherwise, if you're transferring files from Unix to Windows, the end of line character for Unix is differnet than Windows. So a file produced on Unix may not appear properly on a Windows machine.&amp;nbsp; You can usually find this by examining the file in a text editor and looking at the end of line characters in the text file.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your exact code worked fine for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_export.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20345iD4928D7E16D40B5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_export.PNG" alt="delete_export.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try explicitly setting the end of line character using TERMSTR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename myout "C:\_localdata\temp\xxxlexample.txt" termstr=CRLF;
proc export data=sashelp.class outfile=myout      dbms=tab replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 May 2018 15:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Export-from-SAS-to-TXT-file-and-keep-structrure/m-p/459716#M70263</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-03T15:49:50Z</dc:date>
    </item>
  </channel>
</rss>

