<?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: SAS multi array question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520657#M141223</link>
    <description>&lt;P&gt;the code you have provided will not output because you have missing end statements for 2 of your do loops;&lt;/P&gt;
&lt;P&gt;Depending on your end statements will have an impact on the output.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Dec 2018 02:34:45 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2018-12-12T02:34:45Z</dc:date>
    <item>
      <title>SAS multi array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520646#M141221</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask the question as below,&lt;/P&gt;&lt;P&gt;and I have searched for the definition of multi array,&lt;/P&gt;&lt;P&gt;but I still cannot relate to this question.&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;multi array
array multi{1:2, 2} (1,2);
do i=1 to 2;
do j=1 to 2;
Output=multi{i,j};

&lt;/PRE&gt;&lt;P&gt;The question is:&lt;/P&gt;&lt;P&gt;What is the corresponding values of i, j and output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer is 1,1,1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 00:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520646#M141221</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-12-12T00:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multi array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520657#M141223</link>
      <description>&lt;P&gt;the code you have provided will not output because you have missing end statements for 2 of your do loops;&lt;/P&gt;
&lt;P&gt;Depending on your end statements will have an impact on the output.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 02:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520657#M141223</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-12-12T02:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multi array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520658#M141224</link>
      <description>&lt;P&gt;Is there any reason you're not running this and checking it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, the answer is wrong, it's 1, 2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A multi array is row by column, so you've specified 1:2, 2 -&amp;gt; which is 2x2 and 4 entries. You've only initialized the first two values, as 1 and 2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the code for you to run.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
    array multi{1:2, 2} (1, 2);

    do i=1 to 2;

        do j=1 to 2;
            Output=multi{i, j};
            output;
        end;
    end;
run;

proc print data=have;
run;&lt;/PRE&gt;
&lt;P&gt;And here's the documentation reference - it's fairly detailed and thorough in my opinion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0e7601ugjmfgan1vysixzg3a71j.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0e7601ugjmfgan1vysixzg3a71j.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188695"&gt;@jc3992&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to ask the question as below,&lt;/P&gt;
&lt;P&gt;and I have searched for the definition of multi array,&lt;/P&gt;
&lt;P&gt;but I still cannot relate to this question.&lt;/P&gt;
&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;multi array
array multi{1:2, 2} (1,2);
do i=1 to 2;
do j=1 to 2;
Output=multi{i,j};

&lt;/PRE&gt;
&lt;P&gt;The question is:&lt;/P&gt;
&lt;P&gt;What is the corresponding values of i, j and output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer is 1,1,1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 02:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520658#M141224</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-12T02:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multi array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520661#M141226</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Yes, I have checked that documentation too.&lt;/P&gt;&lt;P&gt;But I do not fully understand what it is doing and I am not sure about the code I can write to run it.&lt;/P&gt;&lt;P&gt;I am confused what that (1,2) meant.&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 02:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520661#M141226</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-12-12T02:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multi array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520663#M141227</link>
      <description>&lt;P&gt;&lt;SPAN class="xis-keyword"&gt;ARRAY&lt;/SPAN&gt; &lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;array-name&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;number-of-elements&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;SPAN class="xis-argOptional"&gt;&amp;lt;$&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;length&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;array-elements&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;(&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;initial-value-list&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p19dovt76d4zv4n1h91lg4i12mmm.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p19dovt76d4zv4n1h91lg4i12mmm.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Whenever you can't understand specific&amp;nbsp;syntax, find the&amp;nbsp;&lt;/SPAN&gt;syntax definition in the documentation. It lists the items in the order and you can match them up to figure out what each term means.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188695"&gt;@jc3992&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Yes, I have checked that documentation too.&lt;/P&gt;
&lt;P&gt;But I do not fully understand what it is doing and I am not sure about the code I can write to run it.&lt;/P&gt;
&lt;P&gt;I am confused what that (1,2) meant.&lt;/P&gt;
&lt;P&gt;Thank you very much!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 02:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multi-array-question/m-p/520663#M141227</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-12T02:54:12Z</dc:date>
    </item>
  </channel>
</rss>

