<?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 How to replace values of set of variables in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348910#M10368</link>
    <description>&lt;P&gt;Hi guys,&lt;BR /&gt;&lt;BR /&gt;Can someone help me to change the dataset according to the&amp;nbsp;following?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Khalid&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8252iC707249E80DE9181/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Slide1.JPG" title="Slide1.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 22:34:41 GMT</pubDate>
    <dc:creator>khalidamin</dc:creator>
    <dc:date>2017-04-10T22:34:41Z</dc:date>
    <item>
      <title>How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348910#M10368</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;&lt;BR /&gt;Can someone help me to change the dataset according to the&amp;nbsp;following?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Khalid&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8252iC707249E80DE9181/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Slide1.JPG" title="Slide1.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 22:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348910#M10368</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2017-04-10T22:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348916#M10369</link>
      <description>&lt;P&gt;Whats the rule? All 8s or all the same value? What if you have two the same value and one is missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use MIN/MAX logic - if the min=max then the values are the same and you can use CALL MISSING to set variables to missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Useful functions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;N - returns number of non missing&lt;/P&gt;
&lt;P&gt;NMISS - returns the number of missing&lt;/P&gt;
&lt;P&gt;MIN - returns minimum value&lt;/P&gt;
&lt;P&gt;MAX - returns max value&lt;/P&gt;
&lt;P&gt;CALL MISSING() - sets variables designated to as missing - doesn't matter if they're character or numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. Post data not in images but at least as text, ideally as a data step. We can't write code based on an image so that would mean typing out your dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 22:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348916#M10369</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-10T22:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348937#M10370</link>
      <description>&lt;P&gt;or just use something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  array vars(*) v1-v3;
  if v1=v2=v3 then call missing(of vars(*));
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 00:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/348937#M10370</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-11T00:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349148#M10378</link>
      <description>&lt;P&gt;Thank you for your comments. I want to consider 8s as missing when they are in all variables. For example, if v1=v2=v3=8, then&lt;/P&gt;
&lt;P&gt;v1=v2=v3=missing.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 14:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349148#M10378</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2017-04-11T14:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349149#M10379</link>
      <description>I want 'if v1=v2=v3=8 THEN 'v1=v2=v3=missing'.</description>
      <pubDate>Tue, 11 Apr 2017 14:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349149#M10379</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2017-04-11T14:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349151#M10380</link>
      <description>&lt;P&gt;If v1=8 and v2=8 and v3 =8 then call missing(v1, v2, v3);&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 14:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349151#M10380</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-11T14:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349155#M10381</link>
      <description>&lt;P&gt;Nothing wrong with grouping them together. e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if v1=v2=v3=8 then call missing(of v1-v3);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 15:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349155#M10381</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-11T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values of set of variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349190#M10383</link>
      <description>Awesome! Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 11 Apr 2017 16:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-replace-values-of-set-of-variables/m-p/349190#M10383</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2017-04-11T16:32:07Z</dc:date>
    </item>
  </channel>
</rss>

