<?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 replacing multiple variables with missing values (Data Step) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521446#M141484</link>
    <description>&lt;P&gt;SAS Programmers:&lt;/P&gt;&lt;P&gt;I have a SAS data set with multiple variables. I want to replace one outlier's measured and derived values in the data set with missing values. This can be done using multiple logical if-then statements, but is there a more concise way of doing this, i.e. a single statement indicating the range or span of variables to replace with missing values? For example the following observation in the data set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs_Num Trt1&amp;nbsp;&amp;nbsp; Trt2&amp;nbsp;&amp;nbsp; Tr3&amp;nbsp; Block&amp;nbsp;&amp;nbsp; Var1..................V20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, I want to replace Var5.....Var10 with missing values while retaining everything else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Dec 2018 13:28:31 GMT</pubDate>
    <dc:creator>Kip1</dc:creator>
    <dc:date>2018-12-14T13:28:31Z</dc:date>
    <item>
      <title>replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521446#M141484</link>
      <description>&lt;P&gt;SAS Programmers:&lt;/P&gt;&lt;P&gt;I have a SAS data set with multiple variables. I want to replace one outlier's measured and derived values in the data set with missing values. This can be done using multiple logical if-then statements, but is there a more concise way of doing this, i.e. a single statement indicating the range or span of variables to replace with missing values? For example the following observation in the data set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs_Num Trt1&amp;nbsp;&amp;nbsp; Trt2&amp;nbsp;&amp;nbsp; Tr3&amp;nbsp; Block&amp;nbsp;&amp;nbsp; Var1..................V20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, I want to replace Var5.....Var10 with missing values while retaining everything else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 13:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521446#M141484</guid>
      <dc:creator>Kip1</dc:creator>
      <dc:date>2018-12-14T13:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521447#M141485</link>
      <description>&lt;P&gt;Something like this in your data step ought to work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call missing(of var5-var10);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Dec 2018 13:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521447#M141485</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-14T13:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521466#M141491</link>
      <description>&lt;P&gt;Thanks for the speedy reply. However I believe the call missing routine as written is global. What I need is something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25705i46E5F52504BACBA4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For a single outlier. As you can see, SAS doesn't like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 14:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521466#M141491</guid>
      <dc:creator>Kip1</dc:creator>
      <dc:date>2018-12-14T14:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521490#M141503</link>
      <description>&lt;P&gt;You have made a syntax error. SAS would like it if you used this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if obs='268' then call missing (of par--sqrtpar);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the future, please do not paste code or SAS log as pictures, paste the actual SASLOG text into the {i} window.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521490#M141503</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-14T15:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521497#M141506</link>
      <description>&lt;P&gt;Thanks, that worked. Sorry for posting the image.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521497#M141506</guid>
      <dc:creator>Kip1</dc:creator>
      <dc:date>2018-12-14T15:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521514#M141509</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243227"&gt;@Kip1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, that worked. Sorry for posting the image.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The reason we request code or log entries to be pasted as text is because depending on what is requested we either have or make dummy data to test your code against. If we have to type lines of code that is less likely to happen and possibly result in no answers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&amp;nbsp;for code suggestions it may be much easier to copy and paste your code, edit it and then paste back here with highlights to clarify a point.&lt;/P&gt;
&lt;P&gt;Your code was relatively short but we have had programs running &lt;STRONG&gt;way&lt;/STRONG&gt; longer than that.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521514#M141509</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-14T15:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: replacing multiple variables with missing values (Data Step)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521528#M141516</link>
      <description>&lt;P&gt;Got it. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 16:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replacing-multiple-variables-with-missing-values-Data-Step/m-p/521528#M141516</guid>
      <dc:creator>Kip1</dc:creator>
      <dc:date>2018-12-14T16:03:22Z</dc:date>
    </item>
  </channel>
</rss>

