<?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: array with dynamic name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603968#M175033</link>
    <description>&lt;P&gt;Thanks! That solved my problem.&lt;/P&gt;&lt;P&gt;For the next time i will provide more information about the problem&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 20:50:34 GMT</pubDate>
    <dc:creator>ponder</dc:creator>
    <dc:date>2019-11-13T20:50:34Z</dc:date>
    <item>
      <title>array with dynamic name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603911#M175008</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;I have a data with columnnames column_1 to column_n and i want to create an array out of the columns. n is dynamic.&lt;BR /&gt;&lt;BR /&gt;what i have in mind is&lt;BR /&gt;%let i=5;&lt;BR /&gt;data x;&lt;BR /&gt;set y;&lt;BR /&gt;array var column1-column&amp;amp;i;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;But it does not work. Any suggestion is highly appraciated.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 13 Nov 2019 17:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603911#M175008</guid>
      <dc:creator>ponder</dc:creator>
      <dc:date>2019-11-13T17:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: array with dynamic name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603915#M175010</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/186968"&gt;@ponder&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;It seems that you have a mispelling in the column name (missing underscore).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please test this code and tell us if the issue persists? (please do not hesitate to share the error message)&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
	set y;
	array var(*) column_1-column_&amp;amp;i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 17:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603915#M175010</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-11-13T17:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: array with dynamic name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603955#M175025</link>
      <description>&lt;P&gt;"does not work" on its own is awfully vague and tells us next to nothing. If you have (a) problem(s), post the log, and if you get results that do not meet your expectations, post example data, the result, and what you expected.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 20:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603955#M175025</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-13T20:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: array with dynamic name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603960#M175026</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/186968"&gt;@ponder&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Dear all,&lt;BR /&gt;&lt;BR /&gt;I have a data with columnnames column_1 to column_n and i want to create an array out of the columns. n is dynamic.&lt;BR /&gt;&lt;BR /&gt;what i have in mind is&lt;BR /&gt;%let i=5;&lt;BR /&gt;data x;&lt;BR /&gt;set y;&lt;BR /&gt;array var column1-column&amp;amp;i;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;But it does not work. Any suggestion is highly appraciated.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here is a reference that illustrates how to refer to variables and datasets in a short cut list. Using a list lets you avoid using macros.&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array var(*) column: ;
*this will take all column names that start with column;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 20:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603960#M175026</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-13T20:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: array with dynamic name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603968#M175033</link>
      <description>&lt;P&gt;Thanks! That solved my problem.&lt;/P&gt;&lt;P&gt;For the next time i will provide more information about the problem&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 20:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-with-dynamic-name/m-p/603968#M175033</guid>
      <dc:creator>ponder</dc:creator>
      <dc:date>2019-11-13T20:50:34Z</dc:date>
    </item>
  </channel>
</rss>

