<?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 Creating .txt file without a lastline. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33281#M6466</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That code will NOT write a blank line to the file.&amp;nbsp; You should probably check the settings of your text editor.&lt;/P&gt;&lt;P&gt;Now if you want to write a file where the last line does NOT end with the end-of-line string then you can add an @ to the end of your last PUT statement.&amp;nbsp; Try that and see if your editor likes it better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2012 20:20:23 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-03-15T20:20:23Z</dc:date>
    <item>
      <title>Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33280#M6465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;I'm creating&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;a&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;. txt file&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;via&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;SAS&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;but always&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;at the end of&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;generated file&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;I own&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;a&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;blank line&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;I searched&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;many&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;forums&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;and found no&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;solution&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;other than&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;one&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;created&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;after the last&lt;/SPAN&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;line&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;"put"&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;request&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;Anyone know&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;if you can&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;not created&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;this line&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CODE Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;file "\\srvtbsas06\SASDATA\ma\context\dbm\export\carta\testes.txt";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;put &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;@1 'TESTE' &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;@6 "-1";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;put &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;@1 'TESTE' &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;@6 "-2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;put &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;@1 'TESTE' &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;@6 "-3";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;Attached&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;the result and&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;the expected.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;Tnks!!!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11051iB76EF81BD6713004/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Teste_Expected.bmp" title="Teste_Expected.bmp" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11052i13CD94BF59C850CB/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Teste_Result.bmp" title="Teste_Result.bmp" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 19:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33280#M6465</guid>
      <dc:creator>Samuel_Rocha</dc:creator>
      <dc:date>2012-03-15T19:25:08Z</dc:date>
    </item>
    <item>
      <title>Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33281#M6466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That code will NOT write a blank line to the file.&amp;nbsp; You should probably check the settings of your text editor.&lt;/P&gt;&lt;P&gt;Now if you want to write a file where the last line does NOT end with the end-of-line string then you can add an @ to the end of your last PUT statement.&amp;nbsp; Try that and see if your editor likes it better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 20:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33281#M6466</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-15T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33282#M6467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It might be that you are actually seeing the end of file marker and is dependent on the program.&lt;/P&gt;&lt;P&gt;When I delete &lt;SPAN style="text-decoration: underline;"&gt;all&lt;/SPAN&gt; of the text in a file and close the program, Wordpad will show a "character" if highlighting the start of the file but Notepad does not after reopening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 20:45:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33282#M6467</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-03-15T20:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33283#M6468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers, but adding @ to the and of last put, i have the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is not the editor... The desired is the last line does NOT end with the end-of-line string, the well-known "0D 0A" in hexa...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom, i add this @ in this place, its correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file "\\srvtbsas06\SASDATA\ma\context\dbm\export\carta\testes.txt";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE'&lt;/P&gt;&lt;P&gt;@6 "-1";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE'&lt;/P&gt;&lt;P&gt;@6 "-2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE'&lt;/P&gt;&lt;P&gt;@6 "-3" &lt;STRONG&gt;@&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11795i22626B419841F858/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Exemplo.bmp" title="Exemplo.bmp" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 20:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33283#M6468</guid>
      <dc:creator>Samuel_Rocha</dc:creator>
      <dc:date>2012-03-15T20:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33284#M6469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I suggested does not work. SAS still writes the end of line characters even if you hold the line with the trailing @;&lt;/P&gt;&lt;P&gt;You can see the LF ('0A'x) that Unix SAS has written in the sample below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp; filename tmpfile1 temp;&lt;/P&gt;&lt;P&gt;16&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp; data _NULL_;&lt;/P&gt;&lt;P&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file tmpfile1;&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put @1 'TESTE' @6 "-1";&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put @1 'TESTE' @6 "-2";&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put @1 'TESTE' @6 "-3" @;&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: 3 records were written to the file TMPFILE1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 7.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 7.&lt;/P&gt;&lt;P&gt;23&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile tmpfile1 recfm=f ;&lt;/P&gt;&lt;P&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list;&lt;/P&gt;&lt;P&gt;28&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; CHAR&amp;nbsp; TESTE-1.TESTE-2.TESTE-3. 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZONE&amp;nbsp; 545542305455423054554230&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMR&amp;nbsp; 45345D1A45345D2A45345D3A&lt;/P&gt;&lt;P&gt;NOTE: 1 record was read from the infile TMPFILE1.&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can play around the record format options on the FILE statement. &lt;/P&gt;&lt;P&gt;Here is something that works for this example because the record length is fixed.&lt;/P&gt;&lt;P&gt;Although it did add a space at the end in the place I reserved for the LF in the fixed length records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;72&amp;nbsp;&amp;nbsp; filename tmpfile1 temp;&lt;/P&gt;&lt;P&gt;73&lt;/P&gt;&lt;P&gt;74&amp;nbsp;&amp;nbsp; data _NULL_;&lt;/P&gt;&lt;P&gt;75&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file tmpfile1 recfm=f lrecl=8;&lt;/P&gt;&lt;P&gt;76&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lf='0a'x;&lt;/P&gt;&lt;P&gt;77&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put @1 'TESTE' @6 "-1" @7 lf $1.;&lt;/P&gt;&lt;P&gt;78&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put @1 'TESTE' @6 "-2" @7 lf $1.;&lt;/P&gt;&lt;P&gt;79&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put @1 'TESTE' @6 "-3";&lt;/P&gt;&lt;P&gt;80&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;NOTE: 3 records were written to the file TMPFILE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;81&lt;/P&gt;&lt;P&gt;82&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;83&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile tmpfile1 recfm=f ;&lt;/P&gt;&lt;P&gt;84&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;85&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list;&lt;/P&gt;&lt;P&gt;86&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 &lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; CHAR&amp;nbsp; TESTE-. TESTE-. TESTE-3&amp;nbsp; 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZONE&amp;nbsp; 545542025455420254554232&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMR&amp;nbsp; 45345DA045345DA045345D30&lt;/P&gt;&lt;P&gt;NOTE: 1 record was read from the infile TMPFILE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 21:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33284#M6469</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-15T21:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33285#M6470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would you want a file in that non standard format?&lt;/P&gt;&lt;P&gt;What happens in your editor if you open the file generated by SAS and then save it into a new file?&amp;nbsp; Does the editor add a blank line to the end of the file?&amp;nbsp; If not then what is the issue with using the file as created by SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 21:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33285#M6470</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-15T21:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33286#M6471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need this file in that non standard format becose one supplier of my company... The file generated is available directly to the supplier...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i save into a new file the editor does not add a blank line...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea almost worked, but is added a space (hex "20") at the end of the last record :-(.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can i remove this space manipulating the file into SAS? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file "\\srvtbsas06\SASDATA\ma\context\dbm\export\carta\testes.txt" recfm=F lrecl=8;&lt;/P&gt;&lt;P&gt;lf='0a'x;&lt;/P&gt;&lt;P&gt;put @1 'TESTE' @6 "-1" @8 lf ;&lt;/P&gt;&lt;P&gt;put @1 'TESTE' @6 "-2" @8 lf ;&lt;/P&gt;&lt;P&gt;put @1 'TESTE' @6 "-3";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 11:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33286#M6471</guid>
      <dc:creator>Samuel_Rocha</dc:creator>
      <dc:date>2012-03-16T11:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33287#M6472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try RECFM=N.&lt;/P&gt;&lt;P&gt;This seems to work for your example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;255&amp;nbsp; filename tmpfile1 temp;&lt;/P&gt;&lt;P&gt;256&lt;/P&gt;&lt;P&gt;257&amp;nbsp; data _NULL_;&lt;/P&gt;&lt;P&gt;258&amp;nbsp;&amp;nbsp;&amp;nbsp; file tmpfile1 recfm=n ;&lt;/P&gt;&lt;P&gt;259&amp;nbsp;&amp;nbsp;&amp;nbsp; lf='0d0a'x;&lt;/P&gt;&lt;P&gt;260&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=-1 to -3 by -1;&lt;/P&gt;&lt;P&gt;261&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'TESTE' i 2. @;&lt;/P&gt;&lt;P&gt;262&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i ^=-3 then put lf $2. @;&lt;/P&gt;&lt;P&gt;263&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;264&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: UNBUFFERED is the default with RECFM=N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;265&lt;/P&gt;&lt;P&gt;266&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;267&amp;nbsp;&amp;nbsp;&amp;nbsp; infile tmpfile1 recfm=f ;&lt;/P&gt;&lt;P&gt;268&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;269&amp;nbsp;&amp;nbsp;&amp;nbsp; list;&lt;/P&gt;&lt;P&gt;270&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; CHAR&amp;nbsp; TESTE-1..TESTE-2..TESTE-3 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZONE&amp;nbsp; 5455423005455423005455423&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMR&amp;nbsp; 45345D1DA45345D2DA45345D3&lt;/P&gt;&lt;P&gt;NOTE: 1 record was read from the infile TMPFILE1.&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 13:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33287#M6472</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-16T13:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33288#M6473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you know how many records you have you could also always just to a bit of post processing.&amp;nbsp; e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file "c:\art\testes.txt";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put @1 'TESTE'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @6 "-1";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put @1 'TESTE'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @6 "-2";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put @1 'TESTE'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @6 "-3";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_ ; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FILE "c:\art\testes_want.txt" RECFM=N ; &lt;/P&gt;&lt;P&gt;&amp;nbsp; infile "c:\art\testes.txt" RECFM=N end=eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input VAR1 $CHAR1. @; &lt;/P&gt;&lt;P&gt;&amp;nbsp; if var1 eq '0D'x then counter+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if counter lt 3 then put VAR1 $CHAR1. ; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 13:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33288#M6473</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-16T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33289#M6474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art! thats work perfect!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But after that I had another problem... oh my god...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i upload the file using a ftp i have again de 0D 0A in the file, becose in ftp file i can´t insert a option RECFM=N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename MeuArq ftp "&amp;amp;carta_cd._&amp;amp;dt_gr_arq..txt" cd="&amp;amp;path_destino_carta_FTP."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; host="&amp;amp;FTPservidor." &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user="&amp;amp;FTPusuario." pass="&amp;amp;FTPsenha." debug mprompt lrecl=503;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "&amp;amp;path_saida.\&amp;amp;carta_cd._&amp;amp;dt_gr_arq..txt" lrecl=503;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file MeuArq;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; put _infile_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i resolved this problem, was ugly i know... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I write the file and after this i append 1 row in the end... i do the same for upload by ftp... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file "testes.txt";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE'&lt;/P&gt;&lt;P&gt;@6 "-1";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE'&lt;/P&gt;&lt;P&gt;@6 "-2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE'&lt;/P&gt;&lt;P&gt;@6 "-3";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;file "testes.txt" mod recfm=F lrecl=5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;put&lt;/P&gt;&lt;P&gt;@1 'TESTE';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33289#M6474</guid>
      <dc:creator>Samuel_Rocha</dc:creator>
      <dc:date>2012-03-16T16:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33290#M6475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should move the file as BINARY with FTP to prevent it from adjusting the end-of-line characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33290#M6475</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-16T16:58:55Z</dc:date>
    </item>
    <item>
      <title>Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33291#M6476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try use the option Binary into FTP, but no sucess...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I belive it is becose de "put _infile_" &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename MeuArq ftp "&amp;amp;carta_cd._&amp;amp;dt_gr_arq..txt" cd="&amp;amp;path_destino_carta_FTP."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; host="&amp;amp;FTPservidor." &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rcmd='binary'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user="&amp;amp;FTPusuario." pass="&amp;amp;FTPsenha." debug mprompt lrecl=503;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "&amp;amp;path_saida.\&amp;amp;carta_cd._&amp;amp;dt_gr_arq..txt" lrecl=503;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file MeuArq;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put _infile_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 17:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33291#M6476</guid>
      <dc:creator>Samuel_Rocha</dc:creator>
      <dc:date>2012-03-16T17:33:07Z</dc:date>
    </item>
    <item>
      <title>Creating .txt file without a lastline.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33292#M6477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why bother reading and writing the file?&amp;nbsp; You could use the same method to just send the created file.&amp;nbsp; Take a look at the later example shown in &lt;A href="http://dc-sug.org/ftp.pdf"&gt;http://dc-sug.org/ftp.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 17:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-txt-file-without-a-lastline/m-p/33292#M6477</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-16T17:59:49Z</dc:date>
    </item>
  </channel>
</rss>

