<?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: Output based on the value of next record in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13062#M1806</link>
    <description>Very good idea. Great, ArtC.</description>
    <pubDate>Wed, 15 Jun 2011 09:06:05 GMT</pubDate>
    <dc:creator>Kevin_Graduate</dc:creator>
    <dc:date>2011-06-15T09:06:05Z</dc:date>
    <item>
      <title>Output based on the value of next record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13060#M1804</link>
      <description>The decision to retain the current record is based on the value of a variable (Age) in the next record. If the next record has Age&amp;gt;30, then the current whole record should be kept. Is there any statement to deal with this?&lt;BR /&gt;
&lt;BR /&gt;
Policy    Location    Year    Age&lt;BR /&gt;
142       12              1978   32&lt;BR /&gt;
143       05              1980   31&lt;BR /&gt;
144       17              1990   20&lt;BR /&gt;
&lt;BR /&gt;
So in the output, the first record should be kept, and the second one deleted.</description>
      <pubDate>Tue, 14 Jun 2011 14:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13060#M1804</guid>
      <dc:creator>bncoxuk</dc:creator>
      <dc:date>2011-06-14T14:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Output based on the value of next record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13061#M1805</link>
      <description>Try this.  Obviously you never want the last observation.&lt;BR /&gt;
[pre]data ages;&lt;BR /&gt;
input Policy Location Year Age;&lt;BR /&gt;
datalines;&lt;BR /&gt;
142 12 1978 32&lt;BR /&gt;
143 05 1980 31&lt;BR /&gt;
144 17 1990 20&lt;BR /&gt;
145 05 1992 31&lt;BR /&gt;
146 17 1995 39&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data usenext;&lt;BR /&gt;
   set ages(firstobs=2 keep=age rename=(age=nextage));&lt;BR /&gt;
   set ages;&lt;BR /&gt;
   if nextage&amp;gt;30;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print data=usenext;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 15 Jun 2011 02:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13061#M1805</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2011-06-15T02:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Output based on the value of next record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13062#M1806</link>
      <description>Very good idea. Great, ArtC.</description>
      <pubDate>Wed, 15 Jun 2011 09:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13062#M1806</guid>
      <dc:creator>Kevin_Graduate</dc:creator>
      <dc:date>2011-06-15T09:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Output based on the value of next record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13063#M1807</link>
      <description>Art.C 's code remind me the skill introduced by Peter.C&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data ages;&lt;BR /&gt;
input Policy Location Year Age;&lt;BR /&gt;
datalines;&lt;BR /&gt;
142 12 1978 32&lt;BR /&gt;
143 05 1980 31&lt;BR /&gt;
144 17 1990 20&lt;BR /&gt;
145 05 1992 31&lt;BR /&gt;
146 17 1995 39&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data want(drop=_age);&lt;BR /&gt;
 merge ages ages(keep=age rename=(age=_age) firstobs=2);&lt;BR /&gt;
 if _age gt 30 ;&lt;BR /&gt;
run; &lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Thu, 16 Jun 2011 04:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13063#M1807</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-16T04:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Output based on the value of next record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13064#M1808</link>
      <description>Marvelous ideas of you two.&lt;BR /&gt;
&lt;BR /&gt;
Does Peter C. write any SAS books for me to learn these great ideas?</description>
      <pubDate>Thu, 16 Jun 2011 09:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13064#M1808</guid>
      <dc:creator>Kevin_Graduate</dc:creator>
      <dc:date>2011-06-16T09:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Output based on the value of next record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13065#M1809</link>
      <description>Hi.&lt;BR /&gt;
I called it Merge Skill .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Where are you ,Peter.C?&lt;BR /&gt;
Someone want to talk to you.&lt;BR /&gt;
Maybe you can introduce us some valueable documentations. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Ksharp

Message was edited by: Ksharp</description>
      <pubDate>Fri, 17 Jun 2011 01:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-based-on-the-value-of-next-record/m-p/13065#M1809</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-17T01:34:45Z</dc:date>
    </item>
  </channel>
</rss>

