<?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: Why Does this Array Code Add a Column Named 'i'??? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523223#M4564</link>
    <description>&lt;P&gt;No magic here. Variable i is created as the control variable of the do loop. You can add the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;drop i;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;anywhere within the datastep to prevent variable i from being kept in the results.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Dec 2018 05:45:43 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-12-22T05:45:43Z</dc:date>
    <item>
      <title>Why Does this Array Code Add a Column Named 'i'???</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523221#M4563</link>
      <description>&lt;P&gt;I have the following code to run an array:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HUF_Speech;
set HUF_Speech;

array  SP{66} SP1-SP66;
do i=1 to 66;
if SP{i}=. then SP{i}=0;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Initially there were 83 columns, but surprisingly, after running the code above, a column 'i' is added which has '67' as a value in all rows! How can this be possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Dec 2018 05:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523221#M4563</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-22T05:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does this Array Code Add a Column Named 'i'???</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523223#M4564</link>
      <description>&lt;P&gt;No magic here. Variable i is created as the control variable of the do loop. You can add the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;drop i;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;anywhere within the datastep to prevent variable i from being kept in the results.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Dec 2018 05:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523223#M4564</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-22T05:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does this Array Code Add a Column Named 'i'???</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523224#M4565</link>
      <description>Does this always happen with arrays?</description>
      <pubDate>Sat, 22 Dec 2018 05:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523224#M4565</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-22T05:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does this Array Code Add a Column Named 'i'???</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523225#M4566</link>
      <description>&lt;P&gt;It is not created by the array. It happens with all do loop control variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
do i = 1 to 4;
    output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;creates a dataset with a single variable: i.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Dec 2018 05:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523225#M4566</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-22T05:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does this Array Code Add a Column Named 'i'???</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523226#M4567</link>
      <description>Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sat, 22 Dec 2018 05:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-Does-this-Array-Code-Add-a-Column-Named-i/m-p/523226#M4567</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-22T05:52:54Z</dc:date>
    </item>
  </channel>
</rss>

