<?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: question regarding arrays in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112801#M31226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I understood clearly. Thank you very much Arthur.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jan 2013 06:37:27 GMT</pubDate>
    <dc:creator>sampath</dc:creator>
    <dc:date>2013-01-03T06:37:27Z</dc:date>
    <item>
      <title>question regarding arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112799#M31224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if it is possible to create elements in arrays. I have the following code. I believe _1 _2 _0 are created in this step. Also I am wondering whether "do over col" is same as&amp;nbsp; "do i = 1 to dim(col); &lt;/P&gt;&lt;P&gt;Could you please clarify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data den;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set den ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array col _1 _2 _0 _99 _999;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over col;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col=. then col=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 04:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112799#M31224</guid>
      <dc:creator>sampath</dc:creator>
      <dc:date>2013-01-03T04:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: question regarding arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112800#M31225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With a slight modification of your code you can see that the answers are both yes .. sort of.&amp;nbsp; First, try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data den;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array col _1 _2 _0 _99 _999;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over col;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col=counter;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see after running the code, the five variables do indeed get created, and their assignments in the do over loop are clearly sequential.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I say "sort of" though, as you can only use do over with an implicitly defined array (i.e., where you don't define the number of elements in brackets in the array declaration) and, with implicitly defined arrays, you can't refer to them by number (e.g., col(1)).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 05:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112800#M31225</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-01-03T05:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: question regarding arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112801#M31226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I understood clearly. Thank you very much Arthur.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 06:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-regarding-arrays/m-p/112801#M31226</guid>
      <dc:creator>sampath</dc:creator>
      <dc:date>2013-01-03T06:37:27Z</dc:date>
    </item>
  </channel>
</rss>

