<?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 join based on if key has 1 or 0 in other fields in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769656#M244067</link>
    <description>&lt;P&gt;So I apologize I don't know exactly what this is called but I'll show you what I have and want, I just don't know how to do it. Note, I have tables 1 and 2, I want table 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So Table 1&amp;nbsp;shows which have which modules (AA, BB, CC being the modules, if it shows a 1 then they have it, 0 indicates they don't have it.)&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;Key&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;AA&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;BB&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1002&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table 2 shows a list of just some possible combinations of Key and Module, but the Mods are now in a single column.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;Key&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Mod&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1002&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what I want to do is take Table 2 and filter it down to only where that Key has that Module. So the table I want would look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;Key&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Mod&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1002&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this make sense? I feel like it should be possible but its touch since in Table 1 the Mods are field names where as in Table 2 they are the values in the table. Any and all help very much appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 19:48:51 GMT</pubDate>
    <dc:creator>mhoward2</dc:creator>
    <dc:date>2021-09-22T19:48:51Z</dc:date>
    <item>
      <title>How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769656#M244067</link>
      <description>&lt;P&gt;So I apologize I don't know exactly what this is called but I'll show you what I have and want, I just don't know how to do it. Note, I have tables 1 and 2, I want table 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So Table 1&amp;nbsp;shows which have which modules (AA, BB, CC being the modules, if it shows a 1 then they have it, 0 indicates they don't have it.)&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;Key&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;AA&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;BB&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1002&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table 2 shows a list of just some possible combinations of Key and Module, but the Mods are now in a single column.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;Key&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Mod&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1002&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what I want to do is take Table 2 and filter it down to only where that Key has that Module. So the table I want would look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;Key&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Mod&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1001&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1002&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1003&lt;/TD&gt;
&lt;TD&gt;BB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;CC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1004&lt;/TD&gt;
&lt;TD&gt;AA&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this make sense? I feel like it should be possible but its touch since in Table 1 the Mods are field names where as in Table 2 they are the values in the table. Any and all help very much appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769656#M244067</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-09-22T19:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769695#M244074</link>
      <description>&lt;P&gt;PROC TRANSPOSE + WHERE for first step - not sure I understand the logic of the second step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want (where=(col1 ne 0) rename=_name_ = MOD);
by KEY;
var AA BB CC;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;General idea, untested (my data set options may be formatted uncorrectly).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769695#M244074</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-22T19:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769698#M244075</link>
      <description>&lt;P&gt;Thanks for stopping in. Sorry I wasnt exactly clear. I have tables 1 and 2 and want to join them in a way to get table 3. As you can see, table 2 has entries where a certain Key has an associated Mod, but in table 1 they show a 0 for that Key/Mod. So table 3 would cut that entry out. Does that makes sense? Table 3 is just a version of table 2 where only associated Key/Mod entries have a 1 in table 1.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769698#M244075</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-09-22T19:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769700#M244076</link>
      <description>Then transpose Table1 and merge it with table2?</description>
      <pubDate>Wed, 22 Sep 2021 19:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769700#M244076</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-22T19:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769701#M244077</link>
      <description>&lt;P&gt;Hmmm I'm not sure how that would work. If I did that wouldn't I just be making the Keys into field names instead of the Mods? How will that help me join on Key and Mod?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 20:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769701#M244077</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-09-22T20:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769706#M244081</link>
      <description>&lt;P&gt;I can't code it for you (others can), but I can give you a reasonable approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a DATA step, load Table 2 into a hash table.&amp;nbsp; Then examine each "1" value in Table 1, (calculating MOD along the way), and output when looking in the hash table finds a match.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 20:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769706#M244081</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-09-22T20:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769710#M244084</link>
      <description>&lt;P&gt;Transposing table 1 will turn the variable names into values (in _NAME_ which is renamed to MOD), so you can then join on these values with MOD in table2.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 20:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769710#M244084</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-22T20:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769716#M244086</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data table1;
  input Key	AA	BB	CC;
  cards;
1001	1	0	0
1002	1	1	0
1003	0	1	1
1004	1	0	1
;

data table2;
  input Key	Mod $;
cards;
1001	AA
1001	BB
1002	BB
1003	BB
1003	CC
1004	CC
1004	AA
;

data want;
 merge table2 table1;
 by key;
 if input(vvaluex(mod),32.);
 keep key mod;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 20:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769716#M244086</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-09-22T20:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769887#M244161</link>
      <description>&lt;PRE&gt;data table1;
  input Key	AA	BB	CC;
  cards;
1001	1	0	0
1002	1	1	0
1003	0	1	1
1004	1	0	1
;

data table2;
  input Key	Mod $;
cards;
1001	AA
1001	BB
1002	BB
1003	BB
1003	CC
1004	CC
1004	AA
;

data temp;
 set table1;
 array x{*} AA--CC;
 do i=1 to dim(x);
   if x{i}=1 then do;mod=vname(x{i});output;end;
 end;
 keep key mod;
run;

proc sql;
create table want as
select * from table2
intersect
select * from temp;
quit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Sep 2021 12:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769887#M244161</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-23T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769902#M244170</link>
      <description>&lt;P&gt;Hi! Thanks for helping out! How would I replace the part of your sample code that says "AA--CC" with the actual mods in my data set? Ideally it would be dynamic so the amount of mods and what they are named can change. So is there a different way to populate the array by saying "all other field names" instead of specifying them exactly?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 13:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769902#M244170</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-09-23T13:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769907#M244175</link>
      <description>&lt;P&gt;OK. Try this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data temp;
if 0 then set table1(drop=key);
 array x{*} _numeric_;

 set table1;
 do i=1 to dim(x);
   if x{i}=1 then do;mod=vname(x{i});output;end;
 end;
 keep key mod;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Sep 2021 13:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769907#M244175</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-23T13:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to join based on if key has 1 or 0 in other fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769957#M244206</link>
      <description>&lt;P&gt;Thank you so much this was perfect! I very much appreciate you helping me out!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 15:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-based-on-if-key-has-1-or-0-in-other-fields/m-p/769957#M244206</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-09-23T15:42:24Z</dc:date>
    </item>
  </channel>
</rss>

