<?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 data selection help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37526#M9558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;Currently am generating the report for the processing month (06/01/2011- 07/01/2011)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;and need to select the greatest pidate data from the processing month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;For example,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: %value;"&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&amp;nbsp;&amp;nbsp; PIDATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1234 david 04/22/2011&lt;/P&gt;&lt;P&gt;3456 roy 07/10/2011&lt;/P&gt;&lt;P&gt;4567 yak 06/15/2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8976 ron 06/29/2011&lt;/P&gt;&lt;P&gt;&lt;A&gt;&lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;9087 don 06/29/2011&lt;/SPAN&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;From above i need to select a PIDATE within the processing month (&lt;/SPAN&gt;06/01/2011- 07/01/2011)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;and the greatest pidate value (i.e 06/29/2011)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿Output should be,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;8976 ron 06/29/2011&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A&gt;&lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;9087 don 06/29/2011&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;Please let me know how to apply this logic by using proc sql.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2011 17:31:17 GMT</pubDate>
    <dc:creator>raveena</dc:creator>
    <dc:date>2011-07-27T17:31:17Z</dc:date>
    <item>
      <title>data selection help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37526#M9558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;Currently am generating the report for the processing month (06/01/2011- 07/01/2011)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;and need to select the greatest pidate data from the processing month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;For example,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: %value;"&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&amp;nbsp;&amp;nbsp; PIDATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: %value;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1234 david 04/22/2011&lt;/P&gt;&lt;P&gt;3456 roy 07/10/2011&lt;/P&gt;&lt;P&gt;4567 yak 06/15/2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8976 ron 06/29/2011&lt;/P&gt;&lt;P&gt;&lt;A&gt;&lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;9087 don 06/29/2011&lt;/SPAN&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;From above i need to select a PIDATE within the processing month (&lt;/SPAN&gt;06/01/2011- 07/01/2011)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;and the greatest pidate value (i.e 06/29/2011)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿Output should be,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;8976 ron 06/29/2011&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A&gt;&lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;9087 don 06/29/2011&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;Please let me know how to apply this logic by using proc sql.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿&lt;/SPAN&gt;&lt;A&gt;&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;﻿Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 17:31:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37526#M9558</guid>
      <dc:creator>raveena</dc:creator>
      <dc:date>2011-07-27T17:31:17Z</dc:date>
    </item>
    <item>
      <title>data selection help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37527#M9559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this should work (untested code):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;data&amp;gt;&lt;/P&gt;&lt;P&gt;WHERE pidate BETWEEN '01jun2011'd AND '30Jun2011'd&lt;/P&gt;&lt;P&gt;AND pidate=(SELECT max(pidate) FROM &amp;lt;data&amp;gt; WHERE pidate BETWEEN '01jun2011'd AND '30Jun2011'd );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple of notes:&lt;/P&gt;&lt;P&gt;-- the BETWEEN operator is inclusive, so I modified your dates.&lt;/P&gt;&lt;P&gt;-- this is a correlated subquery, so performance can be poor in large datasets (see documentation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 18:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37527#M9559</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-07-27T18:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: data selection help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37528#M9560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avoid the correlated subquery&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #0000ff;"&gt;select&lt;SPAN style="color: #000000;"&gt; *&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; demo &lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #008080;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; pidate BETWEEN &lt;/SPAN&gt;&lt;STRONG&gt;'01jun2011'd&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;'30Jun2011'd&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;having&lt;/SPAN&gt; pidate EQ max(pidate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does employ remerging.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Doc@Duke wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this should work (untested code):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;data&amp;gt;&lt;/P&gt;&lt;P&gt;WHERE pidate BETWEEN '01jun2011'd AND '30Jun2011'd&lt;/P&gt;&lt;P&gt;AND pidate=(SELECT max(pidate) FROM &amp;lt;data&amp;gt; WHERE pidate BETWEEN '01jun2011'd AND '30Jun2011'd );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple of notes:&lt;/P&gt;&lt;P&gt;-- the BETWEEN operator is inclusive, so I modified your dates.&lt;/P&gt;&lt;P&gt;-- this is a correlated subquery, so performance can be poor in large datasets (see documentation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 21:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37528#M9560</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-07-27T21:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: data selection help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37529#M9561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Howles for your help..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 21:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-selection-help/m-p/37529#M9561</guid>
      <dc:creator>raveena</dc:creator>
      <dc:date>2011-07-27T21:23:13Z</dc:date>
    </item>
  </channel>
</rss>

