<?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 How to - Prevent Data Multiplexing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547033#M151530</link>
    <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sample data sets as below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a customer default within that month, then the ID variable are multiplying. I would like to get the highest default value. I mean that if my target_flg variable is 1 then I need to take the that row (value 1.) Can somebody help me about it, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length ID 8 YearMonth 8 Date 8 Target 8;
Infile Datalines Missover;
Input ID YearMonth Date Target;
Format Date Date9.;
Datalines;
1 201410 20000 0
1 201410 20010 0
1 201410 20015 0
1 201410 20020 1
2 201410 20019 0
2 201410 20013 1
3 201410 20017 1
4 201410 20022 0
5 201410 20012 0
5 201410 20016 1
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Desired Data set;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DesiredTable.png" style="width: 387px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28302i0D05A48FE1B6DF87/image-size/large?v=v2&amp;amp;px=999" role="button" title="DesiredTable.png" alt="DesiredTable.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 20:55:38 GMT</pubDate>
    <dc:creator>ertr</dc:creator>
    <dc:date>2019-03-28T20:55:38Z</dc:date>
    <item>
      <title>How to - Prevent Data Multiplexing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547033#M151530</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sample data sets as below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a customer default within that month, then the ID variable are multiplying. I would like to get the highest default value. I mean that if my target_flg variable is 1 then I need to take the that row (value 1.) Can somebody help me about it, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length ID 8 YearMonth 8 Date 8 Target 8;
Infile Datalines Missover;
Input ID YearMonth Date Target;
Format Date Date9.;
Datalines;
1 201410 20000 0
1 201410 20010 0
1 201410 20015 0
1 201410 20020 1
2 201410 20019 0
2 201410 20013 1
3 201410 20017 1
4 201410 20022 0
5 201410 20012 0
5 201410 20016 1
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Desired Data set;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DesiredTable.png" style="width: 387px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28302i0D05A48FE1B6DF87/image-size/large?v=v2&amp;amp;px=999" role="button" title="DesiredTable.png" alt="DesiredTable.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 20:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547033#M151530</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2019-03-28T20:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Prevent Data Multiplexing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547035#M151532</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length ID 8 YearMonth 8 Date 8 Target 8;
Infile Datalines Missover;
Input ID YearMonth Date Target;
Format Date Date9.;
Datalines;
1 201410 20000 0
1 201410 20010 0
1 201410 20015 0
1 201410 20020 1
2 201410 20019 0
2 201410 20013 1
3 201410 20017 1
4 201410 20022 0
5 201410 20012 0
5 201410 20016 1
;

proc sql;
select *
from have
group by id
having target=max(target)
order by id,target;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2019 21:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547035#M151532</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-28T21:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Prevent Data Multiplexing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547037#M151533</link>
      <description>&lt;P&gt;The above assumes GOOD customers do not have duplicate records&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And does your default ID always have 1 in the last record&amp;nbsp; as neatly sorted as your sample suggests?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if yes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id;
if last.id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should suffice&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 21:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Prevent-Data-Multiplexing/m-p/547037#M151533</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-28T21:07:58Z</dc:date>
    </item>
  </channel>
</rss>

