<?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 sas reading a blank record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178298#M302572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi in my below file below is my file after trailer there is a (.)&lt;/P&gt;&lt;P&gt;So when i execute my data setep , it is telling 4 records have been read. the&amp;nbsp; record after trilaer is being read. I do not want to read that . Any suggestion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;if trailer then delete;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;aa&lt;/P&gt;&lt;P&gt;bb&lt;/P&gt;&lt;P&gt;cc&lt;/P&gt;&lt;P&gt;Tailer&lt;BR /&gt;..&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2014 07:00:25 GMT</pubDate>
    <dc:creator>dennis_oz</dc:creator>
    <dc:date>2014-05-30T07:00:25Z</dc:date>
    <item>
      <title>sas reading a blank record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178298#M302572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi in my below file below is my file after trailer there is a (.)&lt;/P&gt;&lt;P&gt;So when i execute my data setep , it is telling 4 records have been read. the&amp;nbsp; record after trilaer is being read. I do not want to read that . Any suggestion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;if trailer then delete;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;aa&lt;/P&gt;&lt;P&gt;bb&lt;/P&gt;&lt;P&gt;cc&lt;/P&gt;&lt;P&gt;Tailer&lt;BR /&gt;..&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 07:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178298#M302572</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2014-05-30T07:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: sas reading a blank record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178299#M302573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, not really understanding you very well, you don't want any observations after/including the trailer one?&amp;nbsp; Why not just remove them from the datalines step?&amp;nbsp; You could add a retained flag:&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;retain flag;&lt;/P&gt;&lt;P&gt;if _n_=1 then flag=0;&lt;/P&gt;&lt;P&gt;if trailer then flag=1;&lt;/P&gt;&lt;P&gt;if not flag then output;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;aa&lt;/P&gt;&lt;P&gt;bb&lt;/P&gt;&lt;P&gt;cc&lt;/P&gt;&lt;P&gt;Tailer&lt;BR /&gt;..&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is, why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 08:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178299#M302573</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-30T08:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: sas reading a blank record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178300#M302574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dennis ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry not getting&amp;nbsp; your question&amp;nbsp; according to my understanding if there are trailing blanks&lt;/P&gt;&lt;P&gt;remove it by it by input options.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 09:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178300#M302574</guid>
      <dc:creator>sureshsas</dc:creator>
      <dc:date>2014-05-30T09:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: sas reading a blank record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178301#M302575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If '..' is not an acceptable value in any of the previous observations you could.use the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA A;&lt;/P&gt;&lt;P&gt;INPUT NAME $ @;&lt;/P&gt;&lt;P&gt;IF NAME = '..' THEN STOP;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;BB&lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;P&gt;TRAILER&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;&lt;/P&gt;&lt;P&gt;The trailing @ holds the input record so that you can process the item conditionally.&amp;nbsp; In this case we are telling SAS to stop processing once a '..' is read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternately you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA A;&lt;/P&gt;&lt;P&gt;INPUT NAME $ @;&lt;/P&gt;&lt;P&gt;IF NAME = '..' THEN DELETE;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;BB&lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;P&gt;TRAILER&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;This will delete any occurrence of '..'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 10:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178301#M302575</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-05-30T10:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: sas reading a blank record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178302#M302576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if name='Trailer' then stop;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 14:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178302#M302576</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-30T14:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: sas reading a blank record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178303#M302577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input name $10.;&lt;BR /&gt;output;&lt;BR /&gt;if name eq 'Tailer' then stop;&lt;BR /&gt;datalines;&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;cc&lt;BR /&gt;Tailer&lt;/P&gt;&lt;P&gt;..&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 15:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reading-a-blank-record/m-p/178303#M302577</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-05-30T15:17:10Z</dc:date>
    </item>
  </channel>
</rss>

