<?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: %let inside an array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488665#M127398</link>
    <description>&lt;P&gt;Arrays are data step elements and therefore not accessible for macro code. The macro&amp;nbsp;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;PRE&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;STRIKE&gt;&lt;U&gt;&lt;/U&gt;&lt;/STRIKE&gt;processor does its work before the data step is even compiled.&lt;/P&gt;
&lt;P&gt;And even if you use the proper subroutine (call symput), it is a bad idea to store large amounts of values in macro variables (in about 100% of cases). Data is best kept in datasets.&lt;/P&gt;
&lt;P&gt;It is quite easy to create dynamic code off datasets with call execute.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 18:47:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-08-21T18:47:02Z</dc:date>
    <item>
      <title>%let inside an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488662#M127397</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible for me to create an array calling say 150 variables (50 have similar prefix so three with Ax Bx Cx Yx ... Ap Bp Cp Yp... As Bs Cs Ys) and then make a macro within a do group? Then use that %let in the next data step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data work.question;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set ABCY;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array ques(*) A: B: C: Y:&amp;nbsp;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to dim(ques);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ques(i) then do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let county=coun(i);&lt;BR /&gt;&amp;nbsp;end;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on this or suggested reading for this would be greatly appreciated. Thank you so much for your time!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488662#M127397</guid>
      <dc:creator>kmj636</dc:creator>
      <dc:date>2018-08-21T18:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: %let inside an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488665#M127398</link>
      <description>&lt;P&gt;Arrays are data step elements and therefore not accessible for macro code. The macro&amp;nbsp;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;PRE&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;STRIKE&gt;&lt;U&gt;&lt;/U&gt;&lt;/STRIKE&gt;processor does its work before the data step is even compiled.&lt;/P&gt;
&lt;P&gt;And even if you use the proper subroutine (call symput), it is a bad idea to store large amounts of values in macro variables (in about 100% of cases). Data is best kept in datasets.&lt;/P&gt;
&lt;P&gt;It is quite easy to create dynamic code off datasets with call execute.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488665#M127398</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-21T18:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: %let inside an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488671#M127400</link>
      <description>&lt;P&gt;So what I would really like to do is to pull three (of the&amp;nbsp;same prefix)&amp;nbsp;of the 150 into another dataset for processing. I do not want to have to enter each of the variables fifty times. Do you have a better suggestion for this processing?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488671#M127400</guid>
      <dc:creator>kmj636</dc:creator>
      <dc:date>2018-08-21T18:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: %let inside an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488682#M127407</link>
      <description>&lt;P&gt;Please post an example of your source dataset (see my footnotes for hints how to post example datasets), and what you expect to get out of it.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 19:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-inside-an-array/m-p/488682#M127407</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-21T19:11:08Z</dc:date>
    </item>
  </channel>
</rss>

