<?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: How to get rows when condition met in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224837#M53876</link>
    <description>&lt;P&gt;First of all thank you so much for the reply;&lt;/P&gt;&lt;P&gt;You are a genius &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Can you also suggest me where to get information about RETAIN and all it uses.&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2015 20:09:05 GMT</pubDate>
    <dc:creator>siddharthpeesary</dc:creator>
    <dc:date>2015-09-09T20:09:05Z</dc:date>
    <item>
      <title>How to get rows when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224813#M53873</link>
      <description>&lt;P&gt;Detail question&lt;BR /&gt;I have a data set with A,B,C,D... attributes so in C I have {ACE,ALM,BDS} .&lt;/P&gt;&lt;P&gt;so when ever I got "ACE" in C then the output has to get&amp;nbsp; 15 lines from the condition it has met and it has to go until the end of the row.&lt;/P&gt;&lt;P&gt;Can any one provide me the code&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/65i4FA7C9B9DF8C1064/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="Untitled.png" title="Untitled.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 19:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224813#M53873</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-09-09T19:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rows when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224824#M53875</link>
      <description>&lt;P&gt;I'm not 100% this is what you are looking for but here is a solution for how I translated your question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;infile cards dsd ;&lt;BR /&gt;input a$ b$ c$ d$;&lt;BR /&gt;cards;&lt;BR /&gt;,one,,&lt;BR /&gt;,two,,&lt;BR /&gt;ACE,,,&lt;BR /&gt;,two,,&lt;BR /&gt;,three,,&lt;BR /&gt;,four,,&lt;BR /&gt;,five,,&lt;BR /&gt;,six,,&lt;BR /&gt;,seven,,&lt;BR /&gt;,eight,,&lt;BR /&gt;,nine,,&lt;BR /&gt;,ten,,&lt;BR /&gt;,eleven,,&lt;BR /&gt;,twelve,,&lt;BR /&gt;,thirteen,,&lt;BR /&gt;,fourteen,,&lt;BR /&gt;,fifteen,,&lt;BR /&gt;,sixteen,,&lt;BR /&gt;ACE,,,&lt;BR /&gt;,two,,&lt;BR /&gt;,three,,&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want(drop=count ace_count);&lt;BR /&gt;set have;&lt;BR /&gt;count + 1;&lt;BR /&gt;if a = 'ACE' then count = 1;&lt;BR /&gt;retain ace_count;&lt;BR /&gt;if a = 'ACE' then ace_count = 1;&lt;BR /&gt;if count &amp;gt; 15 then ace_count = .;&lt;BR /&gt;if 1 &amp;lt;= count &amp;lt;= 15 and ace_count = 1 then output;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 19:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224824#M53875</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-09-09T19:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rows when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224837#M53876</link>
      <description>&lt;P&gt;First of all thank you so much for the reply;&lt;/P&gt;&lt;P&gt;You are a genius &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Can you also suggest me where to get information about RETAIN and all it uses.&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 20:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224837#M53876</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-09-09T20:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rows when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224851#M53880</link>
      <description>You are welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I would google SAS Retain and look around. There is a ton of information. I prefer anything that is from a sas users group. There's a lot of information available from classes too: &lt;A href="https://onlinecourses.science.psu.edu/stat481/node/36" target="_blank"&gt;https://onlinecourses.science.psu.edu/stat481/node/36&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D14.pdf" target="_blank"&gt;http://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D14.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-rows-when-condition-met/m-p/224851#M53880</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-09-09T21:06:20Z</dc:date>
    </item>
  </channel>
</rss>

