<?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: Problem with Exporting Data to Text File using Put Statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356798#M83710</link>
    <description>&lt;P&gt;Open the file with a more versatile tool like Notepad++. This will tell you the file type (UNIX) in the status line, and siplay the data correctly. To satisfy basic Windows software (like the simple Editor), use the termstr=CRLF option as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt; suggested.&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2017 07:50:17 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-05-08T07:50:17Z</dc:date>
    <item>
      <title>Problem with Exporting Data to Text File using Put Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356758#M83688</link>
      <description>&lt;P&gt;Hi, I got a problem when I tried to export data from a data set&amp;nbsp;to a text file. I'm wondering if anyone can help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So below is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.class;
file '/folders/myfolders/class.txt';
put name age height;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to export the name, age and height variables to a text file. The variables are from sashelp.class and I'm running the code on SAS Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm expecting the data to be exported record by record. So if there are 19 records in sashelp.class, I am expecting the text file will have 19 records as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I look at the text file, all the records stayed in one line. It looks&amp;nbsp;like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alfred 14 69Alice 13 56.5Barbara 13 65.3Carol 14 62.8Henry 14 63.5James 12 57.3Jane 12 59.8Janet 15 62.5Jeffrey 13 62.5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8758iD64446D8131B3C4F/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="test.png" title="test.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why?&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 01:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356758#M83688</guid>
      <dc:creator>kisumsam</dc:creator>
      <dc:date>2017-05-08T01:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Exporting Data to Text File using Put Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356763#M83691</link>
      <description>&lt;P&gt;Works fine for me.&amp;nbsp;Check your Text Editor 'wrap text' option settings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another possibility is since this was created on Unix it's using a Unix end of line character that the text editor isn't understanding. Turn on invisible characters to see what's happening there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 03:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356763#M83691</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-08T03:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Exporting Data to Text File using Put Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356781#M83705</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; said, you are reading a unix file under Windows.&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set SASHELP.CLASS;
  file '/folders/myfolders/class.txt' termstr=CRLF;
  put NAME AGE HEIGHT;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and look up the reasons for this (minor) nonsense if you want. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&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;</description>
      <pubDate>Mon, 08 May 2017 05:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356781#M83705</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-05-08T05:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Exporting Data to Text File using Put Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356798#M83710</link>
      <description>&lt;P&gt;Open the file with a more versatile tool like Notepad++. This will tell you the file type (UNIX) in the status line, and siplay the data correctly. To satisfy basic Windows software (like the simple Editor), use the termstr=CRLF option as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt; suggested.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 07:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Exporting-Data-to-Text-File-using-Put-Statement/m-p/356798#M83710</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-08T07:50:17Z</dc:date>
    </item>
  </channel>
</rss>

