<?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: FLAG IF TWO IDS DON'T AGREE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479090#M123607</link>
    <description>&lt;P&gt;Jeez, That sounds like a poor design of database entities in the first place allowing different insurance ID's for the same person within a year. Well! you know best!&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jul 2018 14:33:22 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-07-18T14:33:22Z</dc:date>
    <item>
      <title>FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479062#M123599</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, my patients (pat_id) have same Medicaid_id (mbr_id). One recipient, one Medicaid ID. However, I figured some patients have multiple Medicaid_ids as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any hints how to&amp;nbsp;flag patients with&amp;nbsp;multiple Medicaid_ids as shown by 'flag' variable in the code block? Patients can be repeated or occur&amp;nbsp;only once in my data. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data p.check;
input mbr_id $ pat_id $ flag;
cards;
NZ12345X PAT-12356912 1
NZ12345X PAT-12356912 1
CZ98650P PAT-12356912 1
PL9562QL PAT-98653232 0
PL9562QL PAT-98653232 0
PL9562QL PAT-98653232 0
QM326598 PAT-74123659 1
QM326598 PAT-74123659 1
PL258960 PAT-74123659 1
LP659865 PAT-00235689 0 
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479062#M123599</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-07-18T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479065#M123600</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
input mbr_id : $10. pat_id : $20.;
cards;
NZ12345X PAT-12356912 1
NZ12345X PAT-12356912 1
CZ98650P PAT-12356912 1
PL9562QL PAT-98653232 0
PL9562QL PAT-98653232 0
PL9562QL PAT-98653232 0
QM326598 PAT-74123659 1
QM326598 PAT-74123659 1
PL258960 PAT-74123659 1
LP659865 PAT-00235689 0 
;

proc sql;
create table want as
select *,count(distinct mbr_id)&amp;gt;1 as flag
from check
group by pat_id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479065#M123600</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-18T14:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479068#M123601</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
if 0 then set check;
flag=0;
do until(last.pat_id);
set check;
by pat_id notsorted;
if first.pat_id then _m=mbr_id;
else if mbr_id ne _m then flag=1;
end;
do until(last.pat_id);
set check;
by pat_id notsorted;
output;
end;
drop _:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479068#M123601</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-18T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479089#M123606</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot. Wow, the disagreement between IDs is worse than I thought. People are having different insurance IDs within just a year and same patient is having 2-4 different IDs. It would have thrown off my analysis had I not assessed like this. Now I know I better&amp;nbsp;stick to patient_id&amp;nbsp;instead Medicaid_id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again. I find proc sql easier to digest and less number of rows. Sure both works.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479089#M123606</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-07-18T14:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479090#M123607</link>
      <description>&lt;P&gt;Jeez, That sounds like a poor design of database entities in the first place allowing different insurance ID's for the same person within a year. Well! you know best!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479090#M123607</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-18T14:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479092#M123608</link>
      <description>Yes, but I used mbr_id as a linkage variable to link three Medicaid files together where Medicaid_id within Medicaid data would show better agreement than to external data which is cancer registry where patient_id comes from. using mbr_id just to link the datasets separated due to storage space issue. Now using patient_id as a unit of my study.</description>
      <pubDate>Wed, 18 Jul 2018 14:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479092#M123608</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-07-18T14:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479093#M123609</link>
      <description>I guess, people tend to upgrade their plan when cancer treatment gets more intensive down the road.</description>
      <pubDate>Wed, 18 Jul 2018 14:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479093#M123609</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-07-18T14:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: FLAG IF TWO IDS DON'T AGREE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479096#M123611</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;Hmm that's some interesting domain. Thank you for sharing. These knowledge adds substance to the thread making it more interesting and intuitive. Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FLAG-IF-TWO-IDS-DON-T-AGREE/m-p/479096#M123611</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-18T14:52:40Z</dc:date>
    </item>
  </channel>
</rss>

