<?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: Unable to define Arrays in SAS University Edtion in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452933#M114358</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;- Okay. I understand now how to use an array. BUt can u explain to me then what is the difference between an array i defined as above and a temperory array ?&amp;nbsp;&lt;BR /&gt;Is there any way i can use an array in a print procedure or is it not allowed in SAS?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 19:34:10 GMT</pubDate>
    <dc:creator>lglovenish96</dc:creator>
    <dc:date>2018-04-10T19:34:10Z</dc:date>
    <item>
      <title>Unable to define Arrays in SAS University Edtion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452923#M114352</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to define an array in SAS University Edition by using the following code :-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;data arraymaking;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;input height weight age @@;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;array test[4] t1 t2 t3 t4 (90 80 70 70);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;datalines;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc print data=arraymaking;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var test[1]&amp;nbsp;;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS throws an error:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Variable TEST not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;72 run;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Can Someone tell me what i am doing wrong ? Why is SAS unable to recognise "Test" as an array?&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Thank You.&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452923#M114352</guid>
      <dc:creator>lglovenish96</dc:creator>
      <dc:date>2018-04-10T19:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define Arrays in SAS University Edtion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452925#M114354</link>
      <description>&lt;P&gt;That's not how arrays work in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They are simply a method to shortcut reference the variables but it does not exist after the data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the second entry you need to use the variable name T1, not test[1] because the TEST array does not exist in the arraymaking data set. It only has the variables included.&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/202259"&gt;@lglovenish96&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been trying to define an array in SAS University Edition by using the following code :-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;data arraymaking;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/187967"&gt;@input&lt;/a&gt; height weight age @@;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;array test[4] t1 t2 t3 t4 (90 80 70 70);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;datalines;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;proc print data=arraymaking;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var test[1]&amp;nbsp;;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS throws an error:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="sasError"&gt;ERROR: Variable TEST not found.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;72 run;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Can Someone tell me what i am doing wrong ? Why is SAS unable to recognise "Test" as an array?&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Thank You.&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452925#M114354</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-10T19:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define Arrays in SAS University Edtion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452933#M114358</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;- Okay. I understand now how to use an array. BUt can u explain to me then what is the difference between an array i defined as above and a temperory array ?&amp;nbsp;&lt;BR /&gt;Is there any way i can use an array in a print procedure or is it not allowed in SAS?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452933#M114358</guid>
      <dc:creator>lglovenish96</dc:creator>
      <dc:date>2018-04-10T19:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define Arrays in SAS University Edtion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452934#M114359</link>
      <description>&lt;P&gt;A temporary array does not include the variables in the output, a permanent array will create the variables, if they do not already exist.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Arrays within the PRINT procedure is not supported, depending on what you're trying to do (you never explained that) there may be other options.&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/202259"&gt;@lglovenish96&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;- Okay. I understand now how to use an array. BUt can u explain to me then what is the difference between an array i defined as above and a temperory array ?&amp;nbsp;&lt;BR /&gt;Is there any way i can use an array in a print procedure or is it not allowed in SAS?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452934#M114359</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-10T19:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define Arrays in SAS University Edtion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452936#M114360</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;- i was trying to print out the array in the proc print statement while making sure the variable name displayed is that of the array element assigned to the variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was Studying the topic for the first time and basically just experimenting with the functionality to get a better idea of how arrays works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452936#M114360</guid>
      <dc:creator>lglovenish96</dc:creator>
      <dc:date>2018-04-10T19:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define Arrays in SAS University Edtion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452942#M114362</link>
      <description>You may want to look into the variable lists and shortcuts then instead. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0wphcpsfgx6o7n1sjtqzizp1n39.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0wphcpsfgx6o7n1sjtqzizp1n39.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-define-Arrays-in-SAS-University-Edtion/m-p/452942#M114362</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-10T19:54:04Z</dc:date>
    </item>
  </channel>
</rss>

