<?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: writing a text file, end of line CR LF in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824135#M325430</link>
    <description>&lt;P&gt;"09"x is a tab, not a LF. LF is "0A"x.&lt;/P&gt;
&lt;P&gt;To manipulate the end-of-line, use the TERMSTR option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file out termstr=CRLF;
outline= cats(var1, var2, var3);
put outline;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Jul 2022 13:36:53 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-07-19T13:36:53Z</dc:date>
    <item>
      <title>writing a text file, end of line CR LF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824127#M325428</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm writing a text file using the following code&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;filename out&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"file_name.txt";&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;data _null_;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set dataA end=eof;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file out;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outline= cats(var1, var2, var3,'09'x);&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put outline;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof then put&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"last_line_txt.";&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;run;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;I get a text file where at the end of each line there are CR LF LF&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;(created by the '09'x)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;I need only CR LF (without the second LF)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;How do I do that?&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;I tried 'ODOA'x instead of the '09'x, but that does not work.&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Thank you!&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824127#M325428</guid>
      <dc:creator>Taliah</dc:creator>
      <dc:date>2022-07-19T13:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: writing a text file, end of line CR LF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824135#M325430</link>
      <description>&lt;P&gt;"09"x is a tab, not a LF. LF is "0A"x.&lt;/P&gt;
&lt;P&gt;To manipulate the end-of-line, use the TERMSTR option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file out termstr=CRLF;
outline= cats(var1, var2, var3);
put outline;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824135#M325430</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-19T13:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: writing a text file, end of line CR LF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824138#M325432</link>
      <description>&lt;P&gt;Works great, Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824138#M325432</guid>
      <dc:creator>Taliah</dc:creator>
      <dc:date>2022-07-19T13:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: writing a text file, end of line CR LF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824185#M325454</link>
      <description>&lt;P&gt;If you want full control use the RECFM=N option on the FILE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
     set dataA end=eof;
     file out recfm=n ;
     outline= cats(var1, var2, var3,'0D0A'x);
     put outline;
     if eof then put "last_line_txt.";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there some reason why you need to make the writing of a text file so complicated?&lt;/P&gt;
&lt;P&gt;Why are you not writing the end of line characters on the last line of the file?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 16:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/writing-a-text-file-end-of-line-CR-LF/m-p/824185#M325454</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-19T16:09:19Z</dc:date>
    </item>
  </channel>
</rss>

