<?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: Delete the last observation in a data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273997#M54627</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
 infile '/folders/myfolders/want.txt' end=last length=len;
 input x $varying200. len;
 if not last then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 May 2016 01:26:09 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-05-31T01:26:09Z</dc:date>
    <item>
      <title>Delete the last observation in a data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273934#M54599</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am using the infile statement to import text files and I am trying to import everything EXCEPT the last row (as it is the Grand Totals). The last row is dynamic, it could be row 14 or row 20. Is there a way to import N-1 rows?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; Work.Test&amp;nbsp;;&lt;BR /&gt;&lt;STRONG&gt;infile&lt;/STRONG&gt; &amp;amp;DataFile&amp;nbsp;dlm=',' firstobs=3 dsd;&lt;BR /&gt;&lt;STRONG&gt;length&lt;/STRONG&gt; Time_Period $30;&lt;BR /&gt;&lt;STRONG&gt;input&lt;/STRONG&gt;&lt;BR /&gt;Time_Period&lt;BR /&gt;ID&lt;BR /&gt;Customers&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 16:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273934#M54599</guid>
      <dc:creator>Chaseg22</dc:creator>
      <dc:date>2016-05-30T16:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Delete the last observation in a data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273951#M54604</link>
      <description>&lt;P&gt;I would try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;infile&lt;/STRONG&gt;&lt;SPAN&gt; &amp;amp;DataFile&amp;nbsp;dlm=',' firstobs=3 dsd obs=nobs;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if _n_ = nobs then stop;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 18:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273951#M54604</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-30T18:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Delete the last observation in a data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273997#M54627</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
 infile '/folders/myfolders/want.txt' end=last length=len;
 input x $varying200. len;
 if not last then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2016 01:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-the-last-observation-in-a-data-Step/m-p/273997#M54627</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-05-31T01:26:09Z</dc:date>
    </item>
  </channel>
</rss>

