<?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 check if for a given value in column a, the value in column b is the same in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570568#M11973</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset that looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;fast&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;fast&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;slow&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;slow&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;other&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;other&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;fast&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;How can I use a macro step to&amp;nbsp;print an error,&amp;nbsp;where values are not one to one in column a and column b? For example in the above dataset "slow"-2, "other"-3 are one to one, but "fast" -1 is not one to one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my output dataset I want:&lt;/P&gt;&lt;P&gt;error&lt;/P&gt;&lt;P&gt;fast -1 is not one to one&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2019 14:06:23 GMT</pubDate>
    <dc:creator>laiguanyu001</dc:creator>
    <dc:date>2019-07-02T14:06:23Z</dc:date>
    <item>
      <title>check if for a given value in column a, the value in column b is the same</title>
      <link>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570568#M11973</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset that looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;fast&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;fast&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;slow&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;slow&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;other&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;other&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;fast&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;How can I use a macro step to&amp;nbsp;print an error,&amp;nbsp;where values are not one to one in column a and column b? For example in the above dataset "slow"-2, "other"-3 are one to one, but "fast" -1 is not one to one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my output dataset I want:&lt;/P&gt;&lt;P&gt;error&lt;/P&gt;&lt;P&gt;fast -1 is not one to one&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 14:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570568#M11973</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-02T14:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: check if for a given value in column a, the value in column b is the same</title>
      <link>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570570#M11974</link>
      <description>&lt;P&gt;Macro not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table want as select distinct a,b from have order by a,b;
quit;

data _null_;
	set want;
	by a;
	if first.a and not last.a then
		put a= b= "is not one to one";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 14:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570570#M11974</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-02T14:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: check if for a given value in column a, the value in column b is the same</title>
      <link>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570573#M11975</link>
      <description>&lt;P&gt;Thanks for the quick response! However this method still requires some eyeballing work. Is there a way to directly print out only the lines with error?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 14:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570573#M11975</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-02T14:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: check if for a given value in column a, the value in column b is the same</title>
      <link>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570574#M11976</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279765"&gt;@laiguanyu001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the quick response! However this method still requires some eyeballing work. Is there a way to directly print out only the lines with error?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I just updated the code to handle this.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 14:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570574#M11976</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-02T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: check if for a given value in column a, the value in column b is the same</title>
      <link>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570576#M11977</link>
      <description>Thank you !!!!</description>
      <pubDate>Tue, 02 Jul 2019 14:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/check-if-for-a-given-value-in-column-a-the-value-in-column-b-is/m-p/570576#M11977</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-02T14:17:50Z</dc:date>
    </item>
  </channel>
</rss>

