<?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: Hunting Down Problem Cases in a Large Data set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77223#M22389</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is actually something that a DATA step does pretty easily.&amp;nbsp; Subject to my understanding the problem correctly, here is one attempt that you can tweak as you see fit.&amp;nbsp; The drawback:&amp;nbsp; it relies on the incoming data being sorted by CASE_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data problems;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by case_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.case_id then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; earlier_dt1 = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; earlier_dt2 = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain earlier_dt1 earlier_dt2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if closing_dt1 &amp;gt; . then earlier_dt1 = closing_dt1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if closing_dt2 &amp;gt; . then earlier_dt2 = closing_dt2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if last.case_id and (closing_dt1 = closing_dt2 = .) and (earlier_dt1 &amp;gt; . or earlier_dt2 &amp;gt; .);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic of which cases are selected may be exactly what you want, or may be very close.&amp;nbsp; But you can test it and see how close it comes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2012 14:39:47 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2012-07-30T14:39:47Z</dc:date>
    <item>
      <title>Hunting Down Problem Cases in a Large Data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77220#M22386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with a very large data set and I need to identify some problem cases. I have to find the cases which are being dropped where the MAX &lt;/P&gt;&lt;P&gt;of &lt;STRONG&gt;CLOSINGS_ID &lt;/STRONG&gt;for the &lt;STRONG&gt;CASE_ID&lt;/STRONG&gt; group is BLANK/NULL and an earlier &lt;STRONG&gt;CLOSE&lt;/STRONG&gt; &lt;STRONG&gt;date&lt;/STRONG&gt; (a calculated variable) has been picked up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cases I’m trying to hunt down look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="margin-left: 4.6pt; padding: 0px 5.4pt; width: 350px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt medium; border-style: solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="51"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Arial;"&gt;CASE_ID&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt medium medium; border-style: solid solid none none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Arial;"&gt;CLOSING_DT_1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt medium medium; border-style: solid solid none none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Arial;"&gt;CLOSING_DT_2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt medium medium; border-style: solid solid none none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="76"&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Arial;"&gt;CLOSINGS_ID&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt medium medium; border-style: solid solid none none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="55"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Arial;"&gt;CLOSE &lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: 1pt solid windowtext; padding: 0px 5.4pt;" valign="bottom" width="51"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;111&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;7-Dec-11&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="76"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="55"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Verdana;"&gt;7-Dec-11&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="51"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;111&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;7-Oct-11&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="76"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="55"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial; color: black;"&gt;7-Oct-11&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="51"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;111&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center"&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="76"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; padding: 0px 5.4pt;" valign="bottom" width="55"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: windowtext; background: none repeat scroll 0% 0% #ffff99; padding: 0px 5.4pt;" valign="bottom" width="51"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;111&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; background: none repeat scroll 0% 0% #ffff99; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; background: none repeat scroll 0% 0% #ffff99; padding: 0px 5.4pt;" valign="bottom" width="84"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; background: none repeat scroll 0% 0% #ffff99; padding: 0px 5.4pt;" valign="bottom" width="76"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: windowtext; background: none repeat scroll 0% 0% #ffff99; padding: 0px 5.4pt;" valign="bottom" width="55"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using these two programs below. One with the HAVING clause and then one without the HAVING clause and then trying all sorts of different ways to combine them together to find with cases which are dropped when the have HAVING clause is used. I can’t figure it out.&amp;nbsp; I just want a list of all these problem cases. Is there a way to do this is Base SAS as well as using Proc SQL as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table &lt;STRONG&gt;With_HAVING&lt;/STRONG&gt; as&lt;/P&gt;&lt;P&gt;select distinct&lt;/P&gt;&lt;P&gt;CASE_ ID,&lt;/P&gt;&lt;P&gt;CLOSING_DT_1,&lt;/P&gt;&lt;P&gt;CLOSING_DT_2&lt;/P&gt;&lt;P&gt;CLOSINGS_ID, &lt;/P&gt;&lt;P&gt;case when CLOSING_DT_2 gt .then CLOSING_DT_2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when CLOSING_DT_1 gt . then CLOSING_DT_1&amp;nbsp; end as CLOSE&lt;/P&gt;&lt;P&gt;from DATA_HAVE&lt;/P&gt;&lt;P&gt;group by CASE_ ID, CLOSINGS_ID&lt;/P&gt;&lt;P&gt;having CLOSINGS_ID =max(CLOSINGS_ID)&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table &lt;STRONG&gt;With_NO_HAVING&lt;/STRONG&gt; as&lt;/P&gt;&lt;P&gt;select distinct&lt;/P&gt;&lt;P&gt;CASE_ ID,&lt;/P&gt;&lt;P&gt;CLOSING_DT_1,&lt;/P&gt;&lt;P&gt;CLOSING_DT_2&lt;/P&gt;&lt;P&gt;CLOSINGS_ID, &lt;/P&gt;&lt;P&gt;case when CLOSING_DT_2 gt .then CLOSING_DT_2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when CLOSING_DT_1 gt . then CLOSING_DT_1&amp;nbsp; end as CLOSE&lt;/P&gt;&lt;P&gt;from DATA_HAVE&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jul 2012 19:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77220#M22386</guid>
      <dc:creator>JakeAZ</dc:creator>
      <dc:date>2012-07-29T19:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Hunting Down Problem Cases in a Large Data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77221#M22387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you could explain it more detail.&lt;/P&gt;&lt;P&gt;What is BLANK/NULL when you refer to MAX .&lt;/P&gt;&lt;P&gt;And what output would you like to see and why you have to use DATA STEP ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 04:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77221#M22387</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-30T04:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hunting Down Problem Cases in a Large Data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77222#M22388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks KSharp.&amp;nbsp; By Blank/Null&amp;nbsp; I am on referring to all the cases where CLOSE is . When I take&amp;nbsp; the highest (MAX) CLOSINGS_ID.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#FF0000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 374px;"&gt;&lt;TBODY&gt;&lt;TR style="font-style: inherit;"&gt;&lt;TD class="xl22" height="18" style="font-style: inherit;" width="64"&gt;CASE_ID&lt;/TD&gt;&lt;TD class="xl23" style="font-style: inherit;" width="64"&gt;CLOSING_DT_1&lt;/TD&gt;&lt;TD class="xl23" style="font-style: inherit;" width="64"&gt;CLOSING_DT_2&lt;/TD&gt;&lt;TD class="xl24" style="font-style: inherit;" width="85"&gt;CLOSINGS_ID&lt;/TD&gt;&lt;TD class="xl23" style="font-style: inherit;" width="97"&gt;CLOSE&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-style: inherit;"&gt;&lt;TD class="xl25" height="18" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;111&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl26" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl27" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;#####&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl26" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl27" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;7-Dec-11&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-style: inherit;"&gt;&lt;TD class="xl28" height="18" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;111&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl29" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;7-Oct-11&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl30" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl30" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl31" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;7-Oct-11&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-style: inherit;"&gt;&lt;TD class="xl28" height="18" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;111&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl30" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl32" style="font-style: inherit;"&gt; &lt;/TD&gt;&lt;TD class="xl30" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl30" style="font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-style: inherit;"&gt;&lt;TD class="xl33" height="18" style="font-style: inherit; background-position: repeat;"&gt;&lt;SPAN style="font-style: inherit;"&gt;111&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl34" style="font-style: inherit; background-position: repeat;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl34" style="font-style: inherit; background-position: repeat;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl34" style="font-style: inherit; background-position: repeat;"&gt;&lt;SPAN style="font-style: inherit;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl35" style="font-style: inherit; color: #000000; text-align: left; padding: 0px; background-color: #ff0000; font-family: arial, helvetica, sans-serif; vertical-align: middle;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, when I take the MAX&amp;nbsp; &lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;CLOSINGS_ID and group&amp;nbsp; by CASE_ID I'm actually dropping a close date when I should pick it up. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 374px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" width="64"&gt;CASE_ID&lt;/TD&gt;&lt;TD class="xl25" width="64"&gt;CLOSING_DT_1&lt;/TD&gt;&lt;TD class="xl25" style="font-style: inherit;" width="64"&gt;CLOSING_DT_2&lt;/TD&gt;&lt;TD class="xl26" style="font-style: inherit;" width="85"&gt;CLOSINGS_ID&lt;/TD&gt;&lt;TD class="xl25" style="font-style: inherit;" width="97"&gt;CLOSE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl27" height="18"&gt;&lt;SPAN style="font-style: inherit;"&gt;111&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl28"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl28"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl28"&gt;&lt;SPAN style="font-style: inherit;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl29" style="color: #575757; text-align: left; padding: 0px; background-color: #ff0000; font-family: arial, helvetica, sans-serif; vertical-align: middle;"&gt;&lt;SPAN style="font-style: inherit;"&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output I need is just a data set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is the above helpful? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 12:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77222#M22388</guid>
      <dc:creator>JakeAZ</dc:creator>
      <dc:date>2012-07-30T12:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hunting Down Problem Cases in a Large Data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77223#M22389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is actually something that a DATA step does pretty easily.&amp;nbsp; Subject to my understanding the problem correctly, here is one attempt that you can tweak as you see fit.&amp;nbsp; The drawback:&amp;nbsp; it relies on the incoming data being sorted by CASE_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data problems;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by case_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.case_id then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; earlier_dt1 = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; earlier_dt2 = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain earlier_dt1 earlier_dt2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if closing_dt1 &amp;gt; . then earlier_dt1 = closing_dt1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if closing_dt2 &amp;gt; . then earlier_dt2 = closing_dt2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if last.case_id and (closing_dt1 = closing_dt2 = .) and (earlier_dt1 &amp;gt; . or earlier_dt2 &amp;gt; .);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic of which cases are selected may be exactly what you want, or may be very close.&amp;nbsp; But you can test it and see how close it comes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 14:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77223#M22389</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-07-30T14:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Hunting Down Problem Cases in a Large Data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77224#M22390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is easy for SQL. If I understand your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
infile cards expandtabs truncover;
input CASE_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CLOSING_DT_1 : date9.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CLOSING_DT_2 : date9.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CLOSINGS_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;
format&amp;nbsp; CLOSING_DT_1 CLOSING_DT_2&amp;nbsp; date11.;
cards;
111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7-Dec-11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7-Oct-11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2
111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4
;
run;
proc sql;
create table close as
 select *,coalesce(CLOSING_DT_1,CLOSING_DT_2) as CLOSE format date11.
&amp;nbsp; from have;

create table dropped as
 select * 
&amp;nbsp; from close 
&amp;nbsp;&amp;nbsp; group by CASE_ID
&amp;nbsp;&amp;nbsp;&amp;nbsp; having CLOSINGS_ID=max(CLOSINGS_ID) and CLOSE is missing;

create table pick_up as
 select * from close
&amp;nbsp; except
 select * from dropped ;

quit;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 02:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hunting-Down-Problem-Cases-in-a-Large-Data-set/m-p/77224#M22390</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-31T02:57:16Z</dc:date>
    </item>
  </channel>
</rss>

