<?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 do I update value using merge statment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17176#M2466</link>
    <description>The order of your datasets listed on the MERGE statement is critical with a match-merge process, where there are duplicate variable names in more than one file you are merging.  The SAS-hosted documentation at the link below discusses, in detail, the topic of One-to-One Merging and provides a specific CAUTION on this topic and the behavior you observed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
SAS 9.2 Language Reference: Concepts, Combining SAS Data Sets: Methods&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001081414.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001081414.htm&lt;/A&gt;</description>
    <pubDate>Mon, 16 Nov 2009 03:10:54 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-11-16T03:10:54Z</dc:date>
    <item>
      <title>how do I update value using merge statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17175#M2465</link>
      <description>Hers is my coding &lt;BR /&gt;
DATA TEMP1;&lt;BR /&gt;
INPUT X 1. Y 1. Z $1.;&lt;BR /&gt;
CARDS;&lt;BR /&gt;
12A&lt;BR /&gt;
23G&lt;BR /&gt;
13D &lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA TEMP2;&lt;BR /&gt;
INPUT X 1. Z $1.;&lt;BR /&gt;
CARDS;&lt;BR /&gt;
1C&lt;BR /&gt;
2B&lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
PROC SORT DATA=TEMP1;&lt;BR /&gt;
BY X;&lt;BR /&gt;
RUN;&lt;BR /&gt;
PROC SORT DATA=TEMP2;&lt;BR /&gt;
BY X;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA TEMP;&lt;BR /&gt;
MERGE TEMP1(IN=A) TEMP2(IN=B);&lt;BR /&gt;
BY X;&lt;BR /&gt;
IF A AND B;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
PROC PRINT DATA=TEMP;&lt;BR /&gt;
RUN;&lt;BR /&gt;
It output results as follow&lt;BR /&gt;
x y z&lt;BR /&gt;
1 2  C&lt;BR /&gt;
1 3  D&lt;BR /&gt;
2 3  B&lt;BR /&gt;
&lt;BR /&gt;
but I expect the below output&lt;BR /&gt;
x y z&lt;BR /&gt;
1 2 C&lt;BR /&gt;
1 3 C&lt;BR /&gt;
2 3 B&lt;BR /&gt;
&lt;BR /&gt;
It seems like my coding update only the 1st by value(1 2 A)not the second(1 3 D).&lt;BR /&gt;
&lt;BR /&gt;
How do I update any duplicate value using merging statment.&lt;BR /&gt;
&lt;BR /&gt;
Thanks so  much in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
Regards.&lt;BR /&gt;
&lt;BR /&gt;
Inp</description>
      <pubDate>Mon, 16 Nov 2009 02:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17175#M2465</guid>
      <dc:creator>Inp</dc:creator>
      <dc:date>2009-11-16T02:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: how do I update value using merge statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17176#M2466</link>
      <description>The order of your datasets listed on the MERGE statement is critical with a match-merge process, where there are duplicate variable names in more than one file you are merging.  The SAS-hosted documentation at the link below discusses, in detail, the topic of One-to-One Merging and provides a specific CAUTION on this topic and the behavior you observed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
SAS 9.2 Language Reference: Concepts, Combining SAS Data Sets: Methods&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001081414.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001081414.htm&lt;/A&gt;</description>
      <pubDate>Mon, 16 Nov 2009 03:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17176#M2466</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-16T03:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: how do I update value using merge statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17177#M2467</link>
      <description>Pls see "How does one-to-many merge behave? " thread.</description>
      <pubDate>Thu, 26 Nov 2009 22:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-I-update-value-using-merge-statment/m-p/17177#M2467</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-11-26T22:25:28Z</dc:date>
    </item>
  </channel>
</rss>

