<?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: Data Manage in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398687#M96462</link>
    <description>&lt;P&gt;Hi BallardW,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick reply and suggestion. Your suggestion will help me for X1, and whenever X1 through X5 ( in this case) have same rule to missout. With this at least I have more than half way simplified since some variables have the same rule, and some have different. When there is different rule, I will use your technique and give different names to the variables that have different rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Sijansap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2017 00:13:34 GMT</pubDate>
    <dc:creator>sijansap</dc:creator>
    <dc:date>2017-09-26T00:13:34Z</dc:date>
    <item>
      <title>Efficiently recode values to missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398677#M96459</link>
      <description>&lt;P&gt;Have data like (but over 20 variables):&lt;/P&gt;
&lt;P&gt;Input X1-X5;&lt;/P&gt;
&lt;P&gt;Cards;&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 10&amp;nbsp; 31&amp;nbsp; 23&amp;nbsp; 42&lt;/P&gt;
&lt;P&gt;41&amp;nbsp; 32&amp;nbsp; 44&amp;nbsp; 02&amp;nbsp; 11&lt;/P&gt;
&lt;P&gt;22&amp;nbsp; 08&amp;nbsp; 34&amp;nbsp; 82&amp;nbsp; 05&lt;/P&gt;
&lt;P&gt;10&amp;nbsp; 45&amp;nbsp; 22&amp;nbsp; 09&amp;nbsp; 10&lt;/P&gt;
&lt;P&gt;....;&amp;nbsp;/*over 30,000 rows*/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want&amp;nbsp;certain values&amp;nbsp;to be empty so that the output will look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31&amp;nbsp;&amp;nbsp; &amp;nbsp;23&amp;nbsp;&amp;nbsp;&amp;nbsp; 42&lt;/P&gt;
&lt;P&gt;41&amp;nbsp;&amp;nbsp; 32&amp;nbsp;&amp;nbsp; 44&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;
&lt;P&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 82&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21&amp;nbsp; &amp;nbsp;45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&amp;nbsp;&amp;nbsp;&amp;nbsp; 09&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;I tried if X1 in ('09', '10', '11') then X1=' '; It works but I have to type 'if then' for all variables.&amp;nbsp;Would there be any short way to solve the problem?&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;Sijansap&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 00:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398677#M96459</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2017-09-26T00:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398678#M96460</link>
      <description>&lt;P&gt;What kind of rules are involved with setting the missing values? You haven't provided much information. Is it only&amp;nbsp;9, 10&amp;nbsp;and 11 that get set to missing or something else? Is the rule exactly the same for all 20 variables or are there different rules for the 20 variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the same rule is applied to multiple variables then likely an array is part of the answer;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; array x x1-x5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; do i=1 to dim(x);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x[i] in ('09','10','11') then call missing(x[i]);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; drop i;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but if the different variables had different rules then you may not have much luck.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 22:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398678#M96460</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-25T22:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398687#M96462</link>
      <description>&lt;P&gt;Hi BallardW,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick reply and suggestion. Your suggestion will help me for X1, and whenever X1 through X5 ( in this case) have same rule to missout. With this at least I have more than half way simplified since some variables have the same rule, and some have different. When there is different rule, I will use your technique and give different names to the variables that have different rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Sijansap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 00:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Efficiently-recode-values-to-missing/m-p/398687#M96462</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2017-09-26T00:13:34Z</dc:date>
    </item>
  </channel>
</rss>

