<?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 Help needed for writing code for resolving issue in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204246#M4544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 6px; color: #141823; font-family: helvetica, arial, 'lucida grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;Hi I have credit card approve/decline tables with one table contains last 8months data, so i have an other table of this month who has appiled for credit card,so what is my requirement is i wanna check weather the customer has already have a card r not ,if he is having i wanna decline tht customer to approve new credit card,so what i want to do is i wanna check latest table (i.e this month table where customer applied for new credit card ,assume tht it contain 10 thousand cu&lt;SPAN class="text_exposed_show"&gt;stumer records) ,to last 8months table(assume tht it contain 1millon customer records),here i enclosing some sample table for example&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 6px;"&gt;/*assume tht its last 8months table which have 1million records*/&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;data table1;&lt;BR /&gt;input custid name$ salary pan$ aprvdate ;&lt;BR /&gt;informat aprv anydtdte.;&lt;BR /&gt;format aprv ddmmyy10.;&lt;BR /&gt;cards;&lt;BR /&gt;001 john 200000 AAAAAA 02/02/2014&lt;BR /&gt;002 raju 300000 BBBBBB 01/01/2013&lt;BR /&gt;002 raju 400002 BBBBBB 01/01/2014&lt;BR /&gt;003 david 600000 CCCCCC 04/04/2013&lt;BR /&gt;004 krishna 203030 DDDDDD 05/02/2015&lt;BR /&gt;005 mukesh 240000 EEEEEE 04/03/2014&lt;BR /&gt;003 david 782226 CCCCCC 08/05/2014&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;/*assume that it contains current table whose wanna apply for new credit cards which contain 10thousand records*/&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;data table2;&lt;BR /&gt;input custid name$ salary pan$ aprv :anydtdte.;&lt;BR /&gt;format aprv ddmmyy10.; &lt;BR /&gt;cards;&lt;BR /&gt;002 raju 400000 BBBBBB 12/05/2015 &lt;BR /&gt;005 mukesh 240000 EEEEEE 12/05/2015&lt;BR /&gt;003 david 782226 CCCCCC 01/7/2015&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;Note :in table one the custmer raju and david had taken 2 cards ,they were already approved ,and check sal and date of approve ,for eg:raju taken cards on 01/01/2013 when his sal was 300000 again he applied for cards in 01/01/2014,again this card was approved and his sal aslo incresed,but in 12/05/2015 again he is applying for new credit cards,so i wanna check with previous table will this guy had already card/not,based on tht i wanna decline this card,and i wanna show my client reason why i m decline,i wanna result should be like this&lt;BR /&gt;002 raju 300000 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400002 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400000 BBBBBB 12/05/2015&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;so this i can show my client where he taken has taken card on 01/01/2013,again by mistakely we approved his card when he applied in 2014,so again this time he is applying for new card on 2015 ,so i gonna decline his application,even mukesh and david is already had card again he is applying in 2015 so i wanna decline him,&lt;BR /&gt;i wanna output like his&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;002 raju 300000 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400002 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400000 BBBBBB 12/05/2015&lt;BR /&gt;003 david 600000 CCCCCC 04/04/2013&lt;BR /&gt;003 david 782226 CCCCCC 08/05/2014&lt;BR /&gt;003 david 782226 CCCCCC 01/7/2015&lt;BR /&gt;005 mukesh 240000 EEEEEE 04/03/2014&lt;BR /&gt;005 mukesh 240000 EEEEEE 12/05/2015&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;so i wanna get output like this based on tht i can show my client these were the customer who had already got cards again they were applying,&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;Assume u have to compare 10thousand records with 1 milon records of previoud month,and pan number will be unique so based on tht we can catch up,&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;so plz write a code to resolve this kind of issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2015 08:46:35 GMT</pubDate>
    <dc:creator>venkatnaveen</dc:creator>
    <dc:date>2015-04-27T08:46:35Z</dc:date>
    <item>
      <title>Help needed for writing code for resolving issue</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204246#M4544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 6px; color: #141823; font-family: helvetica, arial, 'lucida grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;Hi I have credit card approve/decline tables with one table contains last 8months data, so i have an other table of this month who has appiled for credit card,so what is my requirement is i wanna check weather the customer has already have a card r not ,if he is having i wanna decline tht customer to approve new credit card,so what i want to do is i wanna check latest table (i.e this month table where customer applied for new credit card ,assume tht it contain 10 thousand cu&lt;SPAN class="text_exposed_show"&gt;stumer records) ,to last 8months table(assume tht it contain 1millon customer records),here i enclosing some sample table for example&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 6px;"&gt;/*assume tht its last 8months table which have 1million records*/&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;data table1;&lt;BR /&gt;input custid name$ salary pan$ aprvdate ;&lt;BR /&gt;informat aprv anydtdte.;&lt;BR /&gt;format aprv ddmmyy10.;&lt;BR /&gt;cards;&lt;BR /&gt;001 john 200000 AAAAAA 02/02/2014&lt;BR /&gt;002 raju 300000 BBBBBB 01/01/2013&lt;BR /&gt;002 raju 400002 BBBBBB 01/01/2014&lt;BR /&gt;003 david 600000 CCCCCC 04/04/2013&lt;BR /&gt;004 krishna 203030 DDDDDD 05/02/2015&lt;BR /&gt;005 mukesh 240000 EEEEEE 04/03/2014&lt;BR /&gt;003 david 782226 CCCCCC 08/05/2014&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;/*assume that it contains current table whose wanna apply for new credit cards which contain 10thousand records*/&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;data table2;&lt;BR /&gt;input custid name$ salary pan$ aprv :anydtdte.;&lt;BR /&gt;format aprv ddmmyy10.; &lt;BR /&gt;cards;&lt;BR /&gt;002 raju 400000 BBBBBB 12/05/2015 &lt;BR /&gt;005 mukesh 240000 EEEEEE 12/05/2015&lt;BR /&gt;003 david 782226 CCCCCC 01/7/2015&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;Note :in table one the custmer raju and david had taken 2 cards ,they were already approved ,and check sal and date of approve ,for eg:raju taken cards on 01/01/2013 when his sal was 300000 again he applied for cards in 01/01/2014,again this card was approved and his sal aslo incresed,but in 12/05/2015 again he is applying for new credit cards,so i wanna check with previous table will this guy had already card/not,based on tht i wanna decline this card,and i wanna show my client reason why i m decline,i wanna result should be like this&lt;BR /&gt;002 raju 300000 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400002 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400000 BBBBBB 12/05/2015&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;so this i can show my client where he taken has taken card on 01/01/2013,again by mistakely we approved his card when he applied in 2014,so again this time he is applying for new card on 2015 ,so i gonna decline his application,even mukesh and david is already had card again he is applying in 2015 so i wanna decline him,&lt;BR /&gt;i wanna output like his&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;002 raju 300000 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400002 BBBBBB 01/01/2015&lt;BR /&gt;002 raju 400000 BBBBBB 12/05/2015&lt;BR /&gt;003 david 600000 CCCCCC 04/04/2013&lt;BR /&gt;003 david 782226 CCCCCC 08/05/2014&lt;BR /&gt;003 david 782226 CCCCCC 01/7/2015&lt;BR /&gt;005 mukesh 240000 EEEEEE 04/03/2014&lt;BR /&gt;005 mukesh 240000 EEEEEE 12/05/2015&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;so i wanna get output like this based on tht i can show my client these were the customer who had already got cards again they were applying,&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;Assume u have to compare 10thousand records with 1 milon records of previoud month,and pan number will be unique so based on tht we can catch up,&lt;/P&gt;&lt;P style="margin: 6px 0;"&gt;so plz write a code to resolve this kind of issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 08:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204246#M4544</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2015-04-27T08:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for writing code for resolving issue</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204247#M4545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create subsets of your data and update scripts.&amp;nbsp; I.e. create a new table which just has distinct customer, last_date_of_application etc.&amp;nbsp; Then compare your 10,000 records against the smaller table which only contains the data you need.&amp;nbsp; Its a pretty simple merge then:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table APPROVED as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PENDING A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join&amp;nbsp;&amp;nbsp; ALREADY_DONE B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.CUST_ID=B.CUST_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B.CUST_ID is null;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 08:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204247#M4545</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-27T08:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for writing code for resolving issue</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204248#M4546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create table Decline as&lt;/P&gt;&lt;P&gt;select * from table1 where pan in (select pan from table2)&lt;/P&gt;&lt;P&gt;union all&lt;/P&gt;&lt;P&gt;select * from table2 where pan in (select pan from table1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 10:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204248#M4546</guid>
      <dc:creator>gsreddy</dc:creator>
      <dc:date>2015-04-28T10:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for writing code for resolving issue</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204249#M4547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your tables are in SAS then using hash lookup tables could be quite efficient. In case your current month table could contain more than one record per customer then a tweak to below code would be required. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*assume tht its last 8months table which have 1million records*/&lt;/P&gt;&lt;P&gt;data Last8Month;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input custid name$ salary pan$ aprv :anydtdte.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format aprv ddmmyy10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;001 john 200000 AAAAAA 02/02/2014&lt;/P&gt;&lt;P&gt;002 raju 300000 BBBBBB 01/01/2013&lt;/P&gt;&lt;P&gt;002 raju 400002 BBBBBB 01/01/2014&lt;/P&gt;&lt;P&gt;003 david 600000 CCCCCC 04/04/2013&lt;/P&gt;&lt;P&gt;004 krishna 203030 DDDDDD 05/02/2015&lt;/P&gt;&lt;P&gt;005 mukesh 240000 EEEEEE 04/03/2014&lt;/P&gt;&lt;P&gt;003 david 782226 CCCCCC 08/05/2014&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*assume that it contains current table whose wanna apply for new credit cards which contain 10thousand records*/&lt;/P&gt;&lt;P&gt;data Current;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input custid name$ salary pan$ aprv :anydtdte.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format aprv ddmmyy10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;002 raju 400000 BBBBBB 12/05/2015 &lt;/P&gt;&lt;P&gt;005 mukesh 240000 EEEEEE 12/05/2015&lt;/P&gt;&lt;P&gt;003 david 782226 CCCCCC 01/7/2015&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 0 then set Last8Month current;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dcl hash h(dataset:'current');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=h.defineKey('custid');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=h.defineData(all:'y');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=h.defineDone();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dcl hash declined(dataset:'current(obs=0)',ordered:'y',multidata:'n');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=declined.defineKey('custid','aprv');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=declined.defineData(all:'y');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=declined.defineDone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set Last8Month end=last;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if h.check()=0 then &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=declined.add();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=h.find();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=declined.add();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last then declined.output(dataset:'want');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want noobs;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 11:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-needed-for-writing-code-for-resolving-issue/m-p/204249#M4547</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-28T11:08:50Z</dc:date>
    </item>
  </channel>
</rss>

