<?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: Deleting space from output .txt file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87876#M289340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting same output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Feb 2013 10:09:15 GMT</pubDate>
    <dc:creator>santhosh</dc:creator>
    <dc:date>2013-02-01T10:09:15Z</dc:date>
    <item>
      <title>Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87871#M289335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am generating .txt file&lt;/P&gt;&lt;P&gt;i want to fit output text as to data generate&lt;/P&gt;&lt;P&gt;(ie., i dont want to have a space after complte data printed on .txt)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i am putting pointer on last observation and using delte key after generating .txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any way with out using delete key to eliminate last empty row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here i have attached 2 immages to make my question clear&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10912i02E5150E7AF0516B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Output With pointer next line.jpg" title="Output With pointer next line.jpg" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10913iCC980531B71936F7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Output i want.png" title="Output i want.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 09:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87871#M289335</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2013-01-28T09:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87872#M289336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please provide some more information, how do you generate your file (share the program)?&lt;/P&gt;&lt;P&gt;Does your source data have in empty record?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 09:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87872#M289336</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-01-28T09:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87873#M289337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data example;&lt;/P&gt;&lt;P&gt;input name $&amp;nbsp; no marks ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;a 1 30&lt;/P&gt;&lt;P&gt;b 2 20&lt;/P&gt;&lt;P&gt;c 3&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;d 4 15&lt;/P&gt;&lt;P&gt;e 5&amp;nbsp; 20 &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;file "/path.txt";&lt;BR /&gt;set example;&lt;/P&gt;&lt;P&gt;put name $7. ' |'&amp;nbsp; no $2. '|' marks $3,;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after last observation in marks ie 20 the pointer is moving to next line&lt;/P&gt;&lt;P&gt;i want output text pointer end at last observation ie 20&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 05:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87873#M289337</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2013-01-29T05:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87874#M289338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apart from&amp;nbsp; that your example code is not working, I don't get any extra blank row in my files.&lt;/P&gt;&lt;P&gt;I'm in Windows (and you in UNIX?), but I don't that will make any difference.&lt;/P&gt;&lt;P&gt;Why don't you post a working program with a log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 08:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87874#M289338</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-01-29T08:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87875#M289339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like your real problem is with whatever program you are using the read the generated file.&amp;nbsp; You should see if you can adjust that program to accept files in a normal format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to generate a file where the last line of data does not contain an end of line marker then you need to manage when SAS puts the end of line.&amp;nbsp; Using the trailing @ on the put statement will prevent SAS from automatically generating the end of line.&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;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; file "/path.txt";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set example end=eof ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put name $7. ' |'&amp;nbsp; no $2. '|' marks $3. @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if not eof then put ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 15:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87875#M289339</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-01-29T15:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87876#M289340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting same output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 10:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87876#M289340</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2013-02-01T10:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87877#M289341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still have no idea what program would prefer that the last line of a file NOT end in a proper end of line.&amp;nbsp; Are you sure you can't just fix the other program that is expecting files in a non-standard format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to get what you want by using RECFM=N and explicitly writing the end-of-line characters where you want them.&lt;/P&gt;&lt;P&gt;Try this for example.&amp;nbsp; If you are running on Unix then put just '0A'x instead of '0D0A'x ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;filename two '/path.txt' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data example;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input name $&amp;nbsp; no marks;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; file two recfm=n;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if _n_ &amp;gt; 1 then put '0D0A'x ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put name $7. ' |'&amp;nbsp; no 2. '|' marks 3. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;datalines;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;a 1 30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;b 2 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;c 3 .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile two recfm=f lrecl=200 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; list;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;1&amp;nbsp;&amp;nbsp; CHAR&amp;nbsp; a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 1| 30..b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2| 20..c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 3|&amp;nbsp; . 49&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZONE&amp;nbsp; 6222222272372330062222222723723300622222227237222&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMR&amp;nbsp; 10000000C01C030DA20000000C02C020DA30000000C03C00E&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: 1 record was read from the infile TWO.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile two;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; list;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 1| 30 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2| 20 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 3|&amp;nbsp; . 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: 3 records were read from the infile TWO.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 22:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87877#M289341</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-01T22:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting space from output .txt file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87878#M289342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Verry verry Thanks Tom this is working fine &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 09:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-space-from-output-txt-file/m-p/87878#M289342</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2013-02-04T09:07:48Z</dc:date>
    </item>
  </channel>
</rss>

