<?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 - format for .txt file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217826#M53591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You did not specifiy DBMS=, that may be the reason.&lt;/P&gt;&lt;P&gt;In cases like this, I would not use proc export at all;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;file "&amp;amp;MYLOCATION/IDS.TXT";&lt;/P&gt;&lt;P&gt;set USER_IDS;&lt;/P&gt;&lt;P&gt;put ID;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 05:29:45 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2015-05-21T05:29:45Z</dc:date>
    <item>
      <title>Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217825#M53590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SAS data set with one column in character format that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;239438233&lt;/P&gt;&lt;P&gt;485574323&lt;/P&gt;&lt;P&gt;048573493&lt;/P&gt;&lt;P&gt;495840312&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to export it to a .txt file, and have it look the same as above when opening the text file.&amp;nbsp; Unfortunately when I export it and open it in notepad I can't get each ID on its own line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I export the file I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;239438233485574323048573493495840312&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 4 IDs come out as on long string.&amp;nbsp; Here's the code I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA=USER_IDS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTFILE= "&amp;amp;MYLOCATION/IDS.TXT"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUTNAMES=NO;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on modifications I can make to this block of code to get the desired output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 04:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217825#M53590</guid>
      <dc:creator>teg_76</dc:creator>
      <dc:date>2015-05-21T04:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217826#M53591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You did not specifiy DBMS=, that may be the reason.&lt;/P&gt;&lt;P&gt;In cases like this, I would not use proc export at all;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;file "&amp;amp;MYLOCATION/IDS.TXT";&lt;/P&gt;&lt;P&gt;set USER_IDS;&lt;/P&gt;&lt;P&gt;put ID;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 05:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217826#M53591</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-21T05:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217827#M53592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kurt!&amp;nbsp; I tried your code and got the same results, where all the IDs come out in one long string.&amp;nbsp; Then I used my code and played with the DMBS= statement, but couldn't get the desired output, which is one ID on each line in the .txt file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 20:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217827#M53592</guid>
      <dc:creator>teg_76</dc:creator>
      <dc:date>2015-05-21T20:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217828#M53593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC EXPORT DATA=USER_IDS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTFILE= "&amp;amp;MYLOCATION/IDS.TXT"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=dlm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimiter=' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUTNAMES=NO;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this isn't generating one per row, then consider are you generating the output with unix and looking at it in Windows or vice versa?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 20:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217828#M53593</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-21T20:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217829#M53594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your END LINE character is not right . Try :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename x &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"&amp;amp;MYLOCATION/IDS.TXT"&amp;nbsp; termstr=lf;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename x &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"&amp;amp;MYLOCATION/IDS.TXT"&amp;nbsp; termstr=crlf;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC EXPORT DATA=USER_IDS;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTFILE=x &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REPLACE;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUTNAMES=NO;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 12:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217829#M53594</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-22T12:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217830#M53595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You nailed it.&amp;nbsp; That was the problem.&amp;nbsp; I created the file and put in on the Unix Server.&amp;nbsp; The format was correct there.&amp;nbsp; When I moved it to Windows, that's when it became one long string.&amp;nbsp; To solve the issue, within winscp, I went to Options--&amp;gt;Preferences--&amp;gt;Transfers--&amp;gt;Edit--&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...and under "Transfer Mode" checked the 'Automatic' Box&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 16:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/217830#M53595</guid>
      <dc:creator>teg_76</dc:creator>
      <dc:date>2015-05-22T16:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - format for .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/286237#M59480</link>
      <description>&lt;P&gt;&lt;SPAN&gt;filename x &lt;/SPAN&gt;&lt;SPAN&gt;"&amp;amp;MYLOCATION/IDS.TXT"&amp;nbsp; termstr=crlf;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- it works.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 19:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-format-for-txt-file/m-p/286237#M59480</guid>
      <dc:creator>Liu</dc:creator>
      <dc:date>2016-07-21T19:47:55Z</dc:date>
    </item>
  </channel>
</rss>

