<?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 to label rows that don't match in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643964#M192270</link>
    <description>&lt;P&gt;Data step solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id;
retain newvar;
if first.id then newvar = 'N';
if college1 = college2 then newvar = 'Y';
if last.id;
keep id newvar;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If needed, you can join that back to the original dataset.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 14:23:17 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-04-29T14:23:17Z</dc:date>
    <item>
      <title>How to label rows that don't match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643944#M192254</link>
      <description>&lt;P&gt;Hello Everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, please take a look at this data set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp;College1&amp;nbsp; &amp;nbsp; &amp;nbsp;College2&amp;nbsp; &amp;nbsp; &amp;nbsp;NewVariable&lt;BR /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YES&lt;BR /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YES&lt;BR /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YES&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;BR /&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YES&lt;BR /&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YES&lt;BR /&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YES&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to create&amp;nbsp;&lt;STRONG&gt;NewVariable.&amp;nbsp;&lt;/STRONG&gt;Basically, if none of the values of College2 = College1, then NewVariable = No. If all the values of College2 = College1, or if some of the values of College2 = College1, then NewVariable = Yes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 13:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643944#M192254</guid>
      <dc:creator>bourdeax</dc:creator>
      <dc:date>2020-04-29T13:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to label rows that don't match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643957#M192265</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table want as select *,sum(college1=college2) as num
		from have group by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;basically, this creates a new variable NUM which counts the number of matches. I will leave it up to you to turn the 0 match case into "NO" and the cases where there is 1 or more matches into "YES".&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643957#M192265</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-29T14:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to label rows that don't match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643964#M192270</link>
      <description>&lt;P&gt;Data step solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id;
retain newvar;
if first.id then newvar = 'N';
if college1 = college2 then newvar = 'Y';
if last.id;
keep id newvar;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If needed, you can join that back to the original dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643964#M192270</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-29T14:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to label rows that don't match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643981#M192279</link>
      <description>&lt;P&gt;Thank you, Paige. That worked. Also, I appreciate how you answered my main question but left some work for me to do. That is a good teaching technique.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643981#M192279</guid>
      <dc:creator>bourdeax</dc:creator>
      <dc:date>2020-04-29T14:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to label rows that don't match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643983#M192280</link>
      <description>&lt;P&gt;Also, in case anyone wants to know what I did after Paige's section of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;set have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if num = 0 then flag = "N";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else flag = "Y";&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-label-rows-that-don-t-match/m-p/643983#M192280</guid>
      <dc:creator>bourdeax</dc:creator>
      <dc:date>2020-04-29T14:49:54Z</dc:date>
    </item>
  </channel>
</rss>

