<?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 subset a dataset when multiple records exist per subject in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81450#M23480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;Thank you very much for this help.&lt;/P&gt;&lt;P&gt;Your code anabled me to identify shortcomings of "subsetting if" approach in this example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2012 13:49:33 GMT</pubDate>
    <dc:creator>Mirisage</dc:creator>
    <dc:date>2012-06-13T13:49:33Z</dc:date>
    <item>
      <title>How to subset a dataset when multiple records exist per subject</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81448#M23478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;Hi SAS Community,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;I need to separate the account numbers of the attached file with this condition.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; Account_number ^= &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"0"&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; transit=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Retail"&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; product in (&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Personal Loan"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Personal OD"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Res. Mortgage"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;The complexity is some accounts satisfy this condition only in certain months of the account's life. For e.g. account_number&amp;nbsp; No. &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 11pt;"&gt;1111111111&lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; satisfies the condition only in months of 31OCT2010 and 31JAN2012.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;But I need only accounts those satisfy our condition across their entire life cycle.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;Only account 44444444 satisfies this condition. So, a code is required to separate only the four records belong to account 44444444.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;I have tried the “subsetting if” like below but obviously it is not clever enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; Account_number ^= &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"0"&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; transit=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Retail"&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; product in (&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Personal Loan"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Personal OD"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;"Res. Mortgage"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;Could anyone help me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;Mirisage&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: Arial; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;Mirisage&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 03:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81448#M23478</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-06-13T03:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to subset a dataset when multiple records exist per subject</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81449#M23479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you are trying to filter obs and also want to filter groups. SQL is a good tool.&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;
informat current_date date9.;
input current_date account_number $ 13-22 transit $ 25-32 product $ 37-49&amp;nbsp; Arrears_Band $ 53-59;
format current_date date9.;
datalines;
28FEB2010&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31MAR2010&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31OCT2010&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; 1 - 30 
30NOV2010&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31DEC2010&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31JAN2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
28FEB2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31MAR2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
30APR2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31MAY2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
30JUN2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31JUL2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; 1 - 30
31AUG2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
30SEP2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31OCT2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
30NOV2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
31DEC2011&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Corporate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31JAN2012&amp;nbsp;&amp;nbsp; 1111111111&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
28FEB2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31MAR2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30APR2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31MAY2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30JUN2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31JUL2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31AUG2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30SEP2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30NOV2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31DEC2010&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31JAN2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
28FEB2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31MAR2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30APR2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31MAY2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30JUN2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31JUL2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31AUG2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30SEP2011&amp;nbsp;&amp;nbsp; 2222222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Small Bu&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
28FEB2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Corporate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31MAR2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Corporate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
30APR2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Wealth&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Corporate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31MAY2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
30JUN2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31JUL2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31AUG2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
30SEP2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31OCT2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
30NOV2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31DEC2010&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31JAN2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
28FEB2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31MAR2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
30APR2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31MAY2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
30JUN2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31JUL2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31AUG2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
30SEP2011&amp;nbsp;&amp;nbsp; 3333333333&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31OCT2011&amp;nbsp;&amp;nbsp; 4444444444&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal Loan&amp;nbsp;&amp;nbsp; Current
30NOV2011&amp;nbsp;&amp;nbsp; 4444444444&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Res. Mortgage&amp;nbsp;&amp;nbsp; Current
31DEC2011&amp;nbsp;&amp;nbsp; 4444444444&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
31JAN2012&amp;nbsp;&amp;nbsp; 4444444444&amp;nbsp; Retail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Personal OD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current
;
run;

proc sql;
create table want as
 select *
&amp;nbsp; from have 
&amp;nbsp;&amp;nbsp; where Account_number ^= "0"
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by&amp;nbsp; Account_number
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having count(*) eq&amp;nbsp; sum(transit="Retail" and product in ("Personal Loan", "Personal OD", "Res. Mortgage")) ;
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>Wed, 13 Jun 2012 05:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81449#M23479</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-13T05:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to subset a dataset when multiple records exist per subject</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81450#M23480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;Thank you very much for this help.&lt;/P&gt;&lt;P&gt;Your code anabled me to identify shortcomings of "subsetting if" approach in this example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 13:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-subset-a-dataset-when-multiple-records-exist-per-subject/m-p/81450#M23480</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-06-13T13:49:33Z</dc:date>
    </item>
  </channel>
</rss>

