<?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: Retrieving rows by condition in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811389#M33912</link>
    <description>data have;&lt;BR /&gt;&lt;BR /&gt;input id term project sasdate date1&lt;BR /&gt;&lt;BR /&gt;cards;&lt;BR /&gt;&lt;BR /&gt;1 10 197 01may2022 07feb2022&lt;BR /&gt;&lt;BR /&gt;1 10 197 09apr2022&lt;BR /&gt;12mar2022&lt;BR /&gt;&lt;BR /&gt;1 10 197 30apr2022&lt;BR /&gt;15apr2022&lt;BR /&gt;&lt;BR /&gt;1 10 201 31mar2022&lt;BR /&gt;29mar2022&lt;BR /&gt;&lt;BR /&gt;1 10 201 17feb2022&lt;BR /&gt;11jan2022&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;This is the data I've and what I require is sas_date should be greater than date1 and the sas_date should be the earliest date. Once the condition meets that row should be picked by grouping id term project.&lt;BR /&gt;Output table should be like :&lt;BR /&gt;&lt;BR /&gt;1 10 197 09apr2022&lt;BR /&gt;12mar2022&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1 10 201 17feb2022&lt;BR /&gt;11jan2022&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;I hope you got me.</description>
    <pubDate>Wed, 04 May 2022 08:59:42 GMT</pubDate>
    <dc:creator>Pandu2</dc:creator>
    <dc:date>2022-05-04T08:59:42Z</dc:date>
    <item>
      <title>Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810589#M33853</link>
      <description>Hi All,&lt;BR /&gt;I require some assistance from you all.&lt;BR /&gt;I've a table has 10 columns but I require output table based on 2 columns only they are sas_date and amount . And it has data of February to till date. In that I need to keep a condition like if the amount is max for a record then I need the overall rows where the sas_date should be older date.&lt;BR /&gt;Ex:  &lt;BR /&gt;Sas_date    x    y   z  amount&lt;BR /&gt;09feb2022  1   2   3    1&lt;BR /&gt;01feb2022   1   2  3     5&lt;BR /&gt;20mar2022  1   2  3     2&lt;BR /&gt;11apr2022   6   6  7      8&lt;BR /&gt;24feb2022   6    6  7     9&lt;BR /&gt;25mar2022   6    6   7    9&lt;BR /&gt;17apr2022     9    8   6    1&lt;BR /&gt;19mar2022   9     8.  6.    1&lt;BR /&gt;&lt;BR /&gt;Output table should be:&lt;BR /&gt;Sas_date. | X.  Y.  Z. Amount&lt;BR /&gt;01feb2022| 1   2. 3.  5&lt;BR /&gt;24feb 2022 6. 6. 7. 9&lt;BR /&gt;19mar2022  9. 8. 6 1&lt;BR /&gt;If the amount has all 1's for every row then the amount should be same but the sas date should be an older date.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Apr 2022 11:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810589#M33853</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-04-29T11:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810591#M33854</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;In that I need to keep a condition like if the amount is max for a record then I need the overall rows where the sas_date should be older date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm not understanding this. Please explain in more detail and walk us through an example step by step.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 11:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810591#M33854</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-29T11:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810597#M33855</link>
      <description>Hi, thanks for responding.&lt;BR /&gt;Could you please look at the example which I added</description>
      <pubDate>Fri, 29 Apr 2022 12:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810597#M33855</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-04-29T12:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810598#M33856</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/405593"&gt;@Pandu2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi, thanks for responding.&lt;BR /&gt;Could you please look at the example which I added&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As far as I can see, you have not explained anything (which I specifically asked for), nor have you walked us through the example step-by-step (which I specifically asked for). So I still don't understand.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 12:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/810598#M33856</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-29T12:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811389#M33912</link>
      <description>data have;&lt;BR /&gt;&lt;BR /&gt;input id term project sasdate date1&lt;BR /&gt;&lt;BR /&gt;cards;&lt;BR /&gt;&lt;BR /&gt;1 10 197 01may2022 07feb2022&lt;BR /&gt;&lt;BR /&gt;1 10 197 09apr2022&lt;BR /&gt;12mar2022&lt;BR /&gt;&lt;BR /&gt;1 10 197 30apr2022&lt;BR /&gt;15apr2022&lt;BR /&gt;&lt;BR /&gt;1 10 201 31mar2022&lt;BR /&gt;29mar2022&lt;BR /&gt;&lt;BR /&gt;1 10 201 17feb2022&lt;BR /&gt;11jan2022&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;This is the data I've and what I require is sas_date should be greater than date1 and the sas_date should be the earliest date. Once the condition meets that row should be picked by grouping id term project.&lt;BR /&gt;Output table should be like :&lt;BR /&gt;&lt;BR /&gt;1 10 197 09apr2022&lt;BR /&gt;12mar2022&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1 10 201 17feb2022&lt;BR /&gt;11jan2022&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;I hope you got me.</description>
      <pubDate>Wed, 04 May 2022 08:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811389#M33912</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-04T08:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811441#M33919</link>
      <description>&lt;P&gt;Please review your code so that the step works without ERRORs or WARNINGs, then re-post it by copy/pasting the code into a code box opened with the "little running man" icon.&lt;/P&gt;
&lt;P&gt;If you have trouble writing a simple data step, we should tackle this first before you dig deeper into SAS coding, so don't hesitate to ask how to write the step so that it works.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 13:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811441#M33919</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-04T13:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811596#M33949</link>
      <description>Please ignore the errors which I wrote in data step, but please do understand the requirements. Thankyou.</description>
      <pubDate>Thu, 05 May 2022 01:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811596#M33949</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-05T01:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811601#M33950</link>
      <description>&lt;P&gt;If you think you can fix your data step code yourself, do it. Right now I have no idea how your dates are stored.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 04:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811601#M33950</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-05T04:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811630#M33955</link>
      <description>Atleast, please do let me know how to find the earliest date in a bunch of date values. Thankyou.</description>
      <pubDate>Thu, 05 May 2022 10:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811630#M33955</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-05T10:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811633#M33956</link>
      <description>&lt;P&gt;Finding minimum values is done with the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lefunctionsref/p1525p9momafkwn15gm707mtsbat.htm" target="_blank" rel="noopener"&gt;MIN Function&lt;/A&gt;&amp;nbsp;in a data step, or the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/sqlproc/n123fsko39j44pn16zlt087e1m2h.htm" target="_blank" rel="noopener"&gt;MIN Summary Function&lt;/A&gt;&amp;nbsp;in SQL.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 10:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811633#M33956</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-05T10:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811636#M33958</link>
      <description>Can we find the earliest date by using min function with a date9 format . Please provide an example for it. Thankyou.</description>
      <pubDate>Thu, 05 May 2022 11:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811636#M33958</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-05T11:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811637#M33959</link>
      <description>&lt;P&gt;Do you have a numeric variable with a DATE9 format attached, or a character variable that contains the string as posted?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 11:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811637#M33959</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-05T11:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811645#M33961</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/405593"&gt;@Pandu2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;data have;&lt;BR /&gt;&lt;BR /&gt;input id term project sasdate date1&lt;BR /&gt;&lt;BR /&gt;cards;&lt;BR /&gt;&lt;BR /&gt;1 10 197 01may2022 07feb2022&lt;BR /&gt;&lt;BR /&gt;1 10 197 09apr2022&lt;BR /&gt;12mar2022&lt;BR /&gt;&lt;BR /&gt;1 10 197 30apr2022&lt;BR /&gt;15apr2022&lt;BR /&gt;&lt;BR /&gt;1 10 201 31mar2022&lt;BR /&gt;29mar2022&lt;BR /&gt;&lt;BR /&gt;1 10 201 17feb2022&lt;BR /&gt;11jan2022&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;This is the data I've and what I require is sas_date should be greater than date1 and the sas_date should be the earliest date. Once the condition meets that row should be picked by grouping id term project.&lt;BR /&gt;Output table should be like :&lt;BR /&gt;&lt;BR /&gt;1 10 197 09apr2022&lt;BR /&gt;12mar2022&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1 10 201 17feb2022&lt;BR /&gt;11jan2022&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;I hope you got me.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I still don't see you walking us through, step-by-step, how you arrive at the desired output (which I have previously requested). So I don't understand.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 12:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811645#M33961</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-05T12:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811671#M33963</link>
      <description>I've a date variable which is in date9 format.</description>
      <pubDate>Thu, 05 May 2022 14:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811671#M33963</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-05T14:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811684#M33964</link>
      <description>You only have one date1 value in your data. Is this valid for the whole id, for id and term, or id, term and project? If the latter, which value is to be used for the second project?</description>
      <pubDate>Thu, 05 May 2022 14:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811684#M33964</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-05T14:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811697#M33967</link>
      <description>I've two date variables&lt;BR /&gt;1. Sasdate&lt;BR /&gt;2.date1 &lt;BR /&gt;And both these two are valid for whole Id,term, project variables.</description>
      <pubDate>Thu, 05 May 2022 16:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811697#M33967</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-05T16:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving rows by condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811784#M33977</link>
      <description>I apologise, I tried my best to walk you through this. Even if you still don't understand, can you atleast help me on comparing two sas date variables which are in date9 format. Thankyou.&lt;BR /&gt;The comparison should be like sas_date &amp;gt;= date1</description>
      <pubDate>Fri, 06 May 2022 06:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Retrieving-rows-by-condition/m-p/811784#M33977</guid>
      <dc:creator>Pandu2</dc:creator>
      <dc:date>2022-05-06T06:40:51Z</dc:date>
    </item>
  </channel>
</rss>

