<?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 Complicated Data Cleaning Code in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70250#M7002</link>
    <description>Another complicated question.&lt;BR /&gt;
&lt;BR /&gt;
Month-end files contain borrower's status: Defaulted, Non-default, Just defaulted in the current month. Supposedly, borrowers cannot cure their loan within 6 months. That means, if he defualted at 01/2008 and was maked as:&lt;BR /&gt;
&lt;BR /&gt;
01/2008 - Defaulted at current month&lt;BR /&gt;
02/2008  - Defaulted&lt;BR /&gt;
03/2008 - Defaulted&lt;BR /&gt;
04/2008 - Non-default&lt;BR /&gt;
05/2008 - Defaulted &lt;BR /&gt;
06/2008 - Defaulted &lt;BR /&gt;
&lt;BR /&gt;
The record in 04/2008 must be wrong. How can i detect it? so complicated...hope someone can help! Thanks!</description>
    <pubDate>Tue, 20 Jan 2009 04:42:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-01-20T04:42:27Z</dc:date>
    <item>
      <title>Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70250#M7002</link>
      <description>Another complicated question.&lt;BR /&gt;
&lt;BR /&gt;
Month-end files contain borrower's status: Defaulted, Non-default, Just defaulted in the current month. Supposedly, borrowers cannot cure their loan within 6 months. That means, if he defualted at 01/2008 and was maked as:&lt;BR /&gt;
&lt;BR /&gt;
01/2008 - Defaulted at current month&lt;BR /&gt;
02/2008  - Defaulted&lt;BR /&gt;
03/2008 - Defaulted&lt;BR /&gt;
04/2008 - Non-default&lt;BR /&gt;
05/2008 - Defaulted &lt;BR /&gt;
06/2008 - Defaulted &lt;BR /&gt;
&lt;BR /&gt;
The record in 04/2008 must be wrong. How can i detect it? so complicated...hope someone can help! Thanks!</description>
      <pubDate>Tue, 20 Jan 2009 04:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70250#M7002</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-20T04:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70251#M7003</link>
      <description>You can use RETAIN to keep track on the date you want to start you 6 month period. It would help if you transform your MM/YYYYY to SAS date format, then you can use INTCK function or calculate the number of days between the current status date and the original defaulted date.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 20 Jan 2009 12:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70251#M7003</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-20T12:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70252#M7004</link>
      <description>The LAG() function might also be of some help for you.</description>
      <pubDate>Tue, 20 Jan 2009 21:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70252#M7004</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2009-01-20T21:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70253#M7005</link>
      <description>can anyone please share more SAS codes for this question because I am still confused about the code. Thanks a lot!</description>
      <pubDate>Wed, 21 Jan 2009 02:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70253#M7005</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-21T02:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70254#M7006</link>
      <description>I have tried this code, but the list is showing all the borrowers who have changed their Default_Status instead of only the borrower changed their Default_Status from Defaulted to Non_Default within 6 months. Any modification needed?&lt;BR /&gt;
&lt;BR /&gt;
data Temp9 ;&lt;BR /&gt;
changes = -1 ; &lt;BR /&gt;
do until( last.borrid ) ; &lt;BR /&gt;
set Data1 data2 data3...data40;&lt;BR /&gt;
by borrID ;&lt;BR /&gt;
last_Default_Status= lag(Default_Status);&lt;BR /&gt;
if first.borrID then last_Default_Status= ' ' ;&lt;BR /&gt;
if Default_Status ne last_Default_Status then changes + 1 ;&lt;BR /&gt;
end;&lt;BR /&gt;
if changes &amp;gt;1 ;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 21 Jan 2009 02:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70254#M7006</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-21T02:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70255#M7007</link>
      <description>Suggest you share info about your actual data, ideally in a DATA step format, using DATALINES for an instream data example, and show an INPUT statement to read this data -- this info will help us understand what your working with.&lt;BR /&gt;
&lt;BR /&gt;
Fundamentally, the DATA STEP facilities to use with a BY statement, such as:&lt;BR /&gt;
&lt;BR /&gt;
*sort your data using PROC SORT. ;&lt;BR /&gt;
PROC SORT....;&lt;BR /&gt;
  BY ;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
* now analyze patterns of mydate values for  ;&lt;BR /&gt;
* an individual, using the DATA step.          ;&lt;BR /&gt;
DATA ...;&lt;BR /&gt;
  SET ;&lt;BR /&gt;
BY varname1 varname2;&lt;BR /&gt;
IF FIRST.varname2 THEN DO; &lt;BR /&gt;
  * Use RETAIN to keep track of first date across ;&lt;BR /&gt;
  * DATA step executions.                 ;&lt;BR /&gt;
  RETAIN F_mydate 0;&lt;BR /&gt;
  F_mydate = mydate;&lt;BR /&gt;
END;&lt;BR /&gt;
* code to compare mydate to F_mydate;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 21 Jan 2009 02:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70255#M7007</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-01-21T02:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70256#M7008</link>
      <description>My data format is like this:&lt;BR /&gt;
&lt;BR /&gt;
Timekey mmddyy10. ;&lt;BR /&gt;
Borrid $80. ;&lt;BR /&gt;
Source_Id $11. ;&lt;BR /&gt;
BorrName $49. ;&lt;BR /&gt;
DefaultStatus $15. ;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Month-end file: 12/2007&lt;BR /&gt;
&lt;BR /&gt;
Timekey            Borrid              Source_id       BorrName                DefaultStatus&lt;BR /&gt;
12/31/2007        00123456789   4-123456         ABC Company         Defaulted&lt;BR /&gt;
12/31/2007        00987654321   2-157892         XYZ  Company         Non-default&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.</description>
      <pubDate>Wed, 21 Jan 2009 03:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70256#M7008</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-21T03:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Data Cleaning Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70257#M7009</link>
      <description>You might try using a hash table.  There was a great paper from SGF2008 called &lt;A href="http://www.nesug.info/proceedings/nesug06/ap/ap11.pdf"&gt;How Do I Love Hash Tables? Let Me Count the Ways!&lt;/A&gt;.  See the section titled "Deja Vu".  You could change the code to check if DefaultStatus has changed and perform some action based on that information.</description>
      <pubDate>Wed, 21 Jan 2009 16:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Complicated-Data-Cleaning-Code/m-p/70257#M7009</guid>
      <dc:creator>JMo</dc:creator>
      <dc:date>2009-01-21T16:02:36Z</dc:date>
    </item>
  </channel>
</rss>

