<?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 test whether a variable equal to the same value by group? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-test-whether-a-variable-equal-to-the-same-value-by-group/m-p/807791#M318530</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
     class id;
     var price;
    output out=flag min=min max=max;
run;
data want;
    merge have flag;
    by id;
    if min=10 and max=10 then same_price_equal_to_10=1;
    else same_price_equal_to_10=0;
    drop min max;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Apr 2022 12:46:16 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-04-14T12:46:16Z</dc:date>
    <item>
      <title>how to test whether a variable equal to the same value by group?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-test-whether-a-variable-equal-to-the-same-value-by-group/m-p/803626#M316447</link>
      <description>&lt;P&gt;Hi All, I am dealing with a long table (group data) of purchase records. I want to know for each customer, whether they have the exactly same purchase price every time of their visits. Let's say my goal is to test whether the purchase price is $10 for each customer each time they visit.. Below is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID Price&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;4&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what I want is ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID Price&amp;nbsp; Same_Price_equal_to_10&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;Note that if this customer has persistent purchase price of 5... is not nothing I wanted. I want to set a target for the purchase price and only if this targeted purchase price is consistent all the time would be something I wanted... Anyone could help me with that? Very much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 18:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-test-whether-a-variable-equal-to-the-same-value-by-group/m-p/803626#M316447</guid>
      <dc:creator>SAS_taozi</dc:creator>
      <dc:date>2022-03-23T18:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to test whether a variable equal to the same value by group?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-test-whether-a-variable-equal-to-the-same-value-by-group/m-p/807791#M318530</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
     class id;
     var price;
    output out=flag min=min max=max;
run;
data want;
    merge have flag;
    by id;
    if min=10 and max=10 then same_price_equal_to_10=1;
    else same_price_equal_to_10=0;
    drop min max;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2022 12:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-test-whether-a-variable-equal-to-the-same-value-by-group/m-p/807791#M318530</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-14T12:46:16Z</dc:date>
    </item>
  </channel>
</rss>

