<?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: replace values with zeros in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627778#M20579</link>
    <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 06:29:42 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-02-27T06:29:42Z</dc:date>
    <item>
      <title>replace values with zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627765#M20575</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with 288 variables whose name is col2 to col289. I want to replace all values with zeros and the code I used is as below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array n{*} Col2-Col289;
  do i=1 to dim(n);        
    if n{i}=1 then n{i}=0;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;After I used this program, all values are replaced with zeros but there is one more variable called i. All the values in this column are 288. Can anyone tell me why this variable exists and how can I avoid it? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 06:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627765#M20575</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2020-02-27T06:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: replace values with zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627772#M20576</link>
      <description>&lt;P&gt;Your code is fine. &lt;STRONG&gt;i&amp;nbsp;&lt;/STRONG&gt;is your index variable in the do loop. You can safely drop it like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=i);
  set have;
  array n{*} Col2-Col289;
  do i=1 to dim(n);        
    if n{i}=1 then n{i}=0;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 06:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627772#M20576</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-27T06:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: replace values with zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627775#M20578</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 06:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627775#M20578</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2020-02-27T06:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: replace values with zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627778#M20579</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 06:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/replace-values-with-zeros/m-p/627778#M20579</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-27T06:29:42Z</dc:date>
    </item>
  </channel>
</rss>

