<?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: how to display housing and vehicle loan of a customer in the same year in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51977#M1410</link>
    <description>you could use the "old" data step approach.&lt;BR /&gt;
&lt;BR /&gt;
Use your SQL code to get people with both vehicle and home loans.  This would get it down to people with multiple loans in one year:&lt;BR /&gt;
&lt;BR /&gt;
PROC SORT; by year accno loanno;  RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA MultLoans;&lt;BR /&gt;
SET;&lt;BR /&gt;
BY year accno;&lt;BR /&gt;
IF first.accno &amp;amp; last.accno THEN DELETE;  &lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
This would have a few false positives (two cars in one year and house in another), but you could use a similar data step to winnow it further.</description>
    <pubDate>Sat, 18 Dec 2010 20:12:44 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2010-12-18T20:12:44Z</dc:date>
    <item>
      <title>how to display housing and vehicle loan of a customer in the same year</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51976#M1409</link>
      <description>how to display housing(H) and vehicle loan(V)  of a customer who had taken in the same year?&lt;BR /&gt;
table is like that&lt;BR /&gt;
data cust_loan;&lt;BR /&gt;
input accno loanno $ year loan_amount;&lt;BR /&gt;
cards;&lt;BR /&gt;
110010 H023 2006 400000&lt;BR /&gt;
110126 H024 2006 410000&lt;BR /&gt;
110278 H045 2006 420000&lt;BR /&gt;
112345 H046 2007 430000&lt;BR /&gt;
110345 H056 2007 440000&lt;BR /&gt;
110023 V001 2006 45000&lt;BR /&gt;
110126 V002 2006  60000&lt;BR /&gt;
110126 V002 2007  60000&lt;BR /&gt;
110345 V052 2007  60400&lt;BR /&gt;
110127 V512 2007  60078&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
I have got result for cust who had taken both housing and vehicle loan but unable to get the result in the same year. plz check&lt;BR /&gt;
proc sql;&lt;BR /&gt;
select * from cust_loan where loanno like 'H%' and accno in (select accno from cust_loan&lt;BR /&gt;
where loanno like 'V%')&lt;BR /&gt;
UNION ALL&lt;BR /&gt;
select * from cust_loan where loanno like 'V%' and accno in(select accno from cust_loan&lt;BR /&gt;
where loanno like 'H%');&lt;BR /&gt;
quit;</description>
      <pubDate>Sat, 18 Dec 2010 08:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51976#M1409</guid>
      <dc:creator>dash</dc:creator>
      <dc:date>2010-12-18T08:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to display housing and vehicle loan of a customer in the same year</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51977#M1410</link>
      <description>you could use the "old" data step approach.&lt;BR /&gt;
&lt;BR /&gt;
Use your SQL code to get people with both vehicle and home loans.  This would get it down to people with multiple loans in one year:&lt;BR /&gt;
&lt;BR /&gt;
PROC SORT; by year accno loanno;  RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA MultLoans;&lt;BR /&gt;
SET;&lt;BR /&gt;
BY year accno;&lt;BR /&gt;
IF first.accno &amp;amp; last.accno THEN DELETE;  &lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
This would have a few false positives (two cars in one year and house in another), but you could use a similar data step to winnow it further.</description>
      <pubDate>Sat, 18 Dec 2010 20:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51977#M1410</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-12-18T20:12:44Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51978#M1411</link>
      <description>thanks sir, but is it possible to write the same prog in proc sql</description>
      <pubDate>Sun, 19 Dec 2010 04:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51978#M1411</guid>
      <dc:creator>dash</dc:creator>
      <dc:date>2010-12-19T04:49:24Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51979#M1412</link>
      <description>Hello Dash,&lt;BR /&gt;
&lt;BR /&gt;
This is a possible solution:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc SQL;&lt;BR /&gt;
  create table r as select *&lt;BR /&gt;
  from cust_loan&lt;BR /&gt;
  group by year,accno&lt;BR /&gt;
  having count(*) &amp;gt; 1&lt;BR /&gt;
  order by year,accno&lt;BR /&gt;
;quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 20 Dec 2010 21:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-display-housing-and-vehicle-loan-of-a-customer-in-the/m-p/51979#M1412</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-12-20T21:35:54Z</dc:date>
    </item>
  </channel>
</rss>

