<?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 Flag same number from two variables? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363671#M86159</link>
    <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to find out the same ID from two variables ID1 and ID2. &amp;nbsp;Then, I&amp;nbsp;created new variable "Same" to see&amp;nbsp;if there&amp;nbsp;is, and flag&amp;nbsp;it with&amp;nbsp;number&amp;nbsp;1, and count the total number of the same ID. &amp;nbsp;However, the new "same" column is '.'&amp;nbsp; which&amp;nbsp;it is&amp;nbsp;not the result I would like to.&amp;nbsp; I would like to&amp;nbsp;match result shown&amp;nbsp;as the attachment.&amp;nbsp; What is the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test1;&lt;BR /&gt;input ID HR Score;&lt;BR /&gt;cards;&lt;BR /&gt;1 89 60&lt;BR /&gt;2 69 61&lt;BR /&gt;3 49 62&lt;BR /&gt;4 85 63&lt;BR /&gt;5 56 64&lt;BR /&gt;6 75 65&lt;BR /&gt;7 90 66&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test2;&lt;BR /&gt;input ID TR Score;&lt;BR /&gt;cards;&lt;BR /&gt;2 60 50&lt;BR /&gt;4 61 40&lt;BR /&gt;6 62 60&lt;BR /&gt;8 63 65&lt;BR /&gt;9 64 78&lt;BR /&gt;10 65 79&lt;BR /&gt;11 66 90&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testID1;&lt;BR /&gt;set test1 (keep=ID);&lt;BR /&gt;by ID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testID2;&lt;BR /&gt;set test2 (keep=ID);&lt;BR /&gt;by ID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test12;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;merge&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; testID1(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=intestID1 rename=(ID=ID1))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;testID2(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=intestID2 rename=(ID=ID2));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test13;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test12;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID1 = ID2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;same = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2017 12:01:22 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2017-06-02T12:01:22Z</dc:date>
    <item>
      <title>Flag same number from two variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363671#M86159</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to find out the same ID from two variables ID1 and ID2. &amp;nbsp;Then, I&amp;nbsp;created new variable "Same" to see&amp;nbsp;if there&amp;nbsp;is, and flag&amp;nbsp;it with&amp;nbsp;number&amp;nbsp;1, and count the total number of the same ID. &amp;nbsp;However, the new "same" column is '.'&amp;nbsp; which&amp;nbsp;it is&amp;nbsp;not the result I would like to.&amp;nbsp; I would like to&amp;nbsp;match result shown&amp;nbsp;as the attachment.&amp;nbsp; What is the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test1;&lt;BR /&gt;input ID HR Score;&lt;BR /&gt;cards;&lt;BR /&gt;1 89 60&lt;BR /&gt;2 69 61&lt;BR /&gt;3 49 62&lt;BR /&gt;4 85 63&lt;BR /&gt;5 56 64&lt;BR /&gt;6 75 65&lt;BR /&gt;7 90 66&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test2;&lt;BR /&gt;input ID TR Score;&lt;BR /&gt;cards;&lt;BR /&gt;2 60 50&lt;BR /&gt;4 61 40&lt;BR /&gt;6 62 60&lt;BR /&gt;8 63 65&lt;BR /&gt;9 64 78&lt;BR /&gt;10 65 79&lt;BR /&gt;11 66 90&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testID1;&lt;BR /&gt;set test1 (keep=ID);&lt;BR /&gt;by ID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testID2;&lt;BR /&gt;set test2 (keep=ID);&lt;BR /&gt;by ID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test12;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;merge&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; testID1(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=intestID1 rename=(ID=ID1))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;testID2(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=intestID2 rename=(ID=ID2));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test13;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test12;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID1 = ID2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;same = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 12:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363671#M86159</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-02T12:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Flag same number from two variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363675#M86161</link>
      <description>&lt;P&gt;There's no BY statement in your MERGE.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363675#M86161</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Flag same number from two variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363686#M86169</link>
      <description>&lt;P&gt;Also, how to count the total number of the same ID. &amp;nbsp;Please see the attachment. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 03:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363686#M86169</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-02T03:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Flag same number from two variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363687#M86170</link>
      <description>&lt;P&gt;Is your original question answered?&lt;/P&gt;
&lt;P&gt;If so, mark this question as solved and please ask a new one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I won't open attachments so post everything directly into the forum.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 03:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363687#M86170</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T03:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Flag same number from two variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363762#M86176</link>
      <description>&lt;P&gt;Hi, Reeza: I have added by on the merged dataset.&amp;nbsp; It doesn't work.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 11:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-same-number-from-two-variables/m-p/363762#M86176</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-02T11:57:14Z</dc:date>
    </item>
  </channel>
</rss>

