<?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: merge without id variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/393883#M94891</link>
    <description>&lt;P&gt;Show some example data and what the files should look like after merging. Also if there are duplicates of the values involved in either data set then include an example so we can tell what need's to be done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2017 14:20:08 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-09-07T14:20:08Z</dc:date>
    <item>
      <title>merge without id variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/393880#M94889</link>
      <description>&lt;P&gt;I need to create a flag where in one dataset i have few terms like andy, parci, mubdi and if in the other dataset i have these terms it should be flagged as Y. How can i merge them?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/393880#M94889</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-09-07T14:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: merge without id variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/393883#M94891</link>
      <description>&lt;P&gt;Show some example data and what the files should look like after merging. Also if there are duplicates of the values involved in either data set then include an example so we can tell what need's to be done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/393883#M94891</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-07T14:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: merge without id variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/394015#M94913</link>
      <description>&lt;P&gt;Here is one way guessing on the info we have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check_file;
   input data1 data2 checkterm $8.;
datalines;
1 2 andi
2 2 parka
3 3 whoopi
3 4 parci
6 5 mubdi
8 4 mudbi
9 1 parci
3 2 andy
5 3 andi
;
run;


data reference_file;
   input referenceterm $8.;
datalines;
parci
mubdi
andy
;
run;


proc sql;
	create table flagged_check_file as
	select data1, data2, checkterm,
	case when checkterm in (select referenceterm from reference_file) then 1 else 0 end as term_flagged
	from check_file;
quit;


proc print noobs;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which gives us:&lt;/P&gt;
&lt;PRE&gt;                                                                    term_
                                    data1    data2    checkterm    flagged

                                      1        2       andi           0
                                      2        2       parka          0
                                      3        3       whoopi         0
                                      3        4       parci          1
                                      6        5       mubdi          1
                                      8        4       mudbi          0
                                      9        1       parci          1
                                      3        2       andy           1
                                      5        3       andi           0

&lt;/PRE&gt;
&lt;P&gt;But i agree with ballardw, post more info.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 19:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/394015#M94913</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2017-09-07T19:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: merge without id variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/394148#M94942</link>
      <description>data WANT;&lt;BR /&gt;input YOUR_TERMS: $1.;&lt;BR /&gt;cards;&lt;BR /&gt;A&lt;BR /&gt;B&lt;BR /&gt;C&lt;BR /&gt;D&lt;BR /&gt;E&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data WISH;&lt;BR /&gt;set WANT(obs=3);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;alter table WANT&lt;BR /&gt;add WHAT_U_WANT CHAR (1);&lt;BR /&gt;&lt;BR /&gt;update WANT&lt;BR /&gt;set WHAT_U_WANT='Y'&lt;BR /&gt;where YOUR_TERMS in (select YOUR_TERMS from WISH);&lt;BR /&gt;quit;</description>
      <pubDate>Fri, 08 Sep 2017 08:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-without-id-variable/m-p/394148#M94942</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-09-08T08:05:12Z</dc:date>
    </item>
  </channel>
</rss>

