<?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: Call execute - list of values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399939#M96897</link>
    <description>&lt;P&gt;Perhaps you should expand on what you are doing with those macro variables. Since you are using a dataset apparently if you do nothing else with the call execute facility in the data step you use call execute the result will likely only have the values from the last record of the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are generating other code with call execute then you would use the values more or less directly in the call execute statements.&lt;/P&gt;
&lt;P&gt;So I am not seeing the advantage of attempting to use call execute to create macro variables.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2017 22:19:57 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-09-29T22:19:57Z</dc:date>
    <item>
      <title>Call execute - list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399929#M96894</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to define a list of values (for example, the values of two different columns in a table) into a macro variable using &lt;EM&gt;call execute&lt;/EM&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;L.*&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 21:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399929#M96894</guid>
      <dc:creator>May15</dc:creator>
      <dc:date>2017-09-29T21:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute - list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399939#M96897</link>
      <description>&lt;P&gt;Perhaps you should expand on what you are doing with those macro variables. Since you are using a dataset apparently if you do nothing else with the call execute facility in the data step you use call execute the result will likely only have the values from the last record of the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are generating other code with call execute then you would use the values more or less directly in the call execute statements.&lt;/P&gt;
&lt;P&gt;So I am not seeing the advantage of attempting to use call execute to create macro variables.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 22:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399939#M96897</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-29T22:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute - list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399965#M96904</link>
      <description>&lt;P&gt;CALL EXECUTE is designed to avoid exactly that situation....more details are needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL will create lists of macro variables from a table. In general, that's the easiest way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=p0lsf4btafkw9mn1md4c69kkfwbl.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=p0lsf4btafkw9mn1md4c69kkfwbl.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;P&gt;EDIT: And the CALL EXECUTE documentation does a good job of illustrating how to use it to call a macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1blnvlvciwgs9n0zcilud6d6ei9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1blnvlvciwgs9n0zcilud6d6ei9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 02:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399965#M96904</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-30T02:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute - list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399998#M96924</link>
      <description>&lt;P&gt;Notice that this is such a bad idea that nobody bothered to ask what you want your list to look like. You really didn't specify where you want commas, quotes, or what the order should be when using two columns.&amp;nbsp; Just in case you really need to do it this way (doubtful), here is how you would do it with a single column (assumed here to be a character variable).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%global list;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;set many_columns;&lt;/P&gt;
&lt;P&gt;call execute('%let list = &amp;amp;list ' || column_1 || ';' ) ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 13:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/399998#M96924</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-30T13:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute - list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/400080#M96964</link>
      <description>&lt;P&gt;CALL EXECUTE() just takes a string and pushes it onto the stack for SAS to run after the current step ends.&amp;nbsp; You ned to explain your actual problem in more detail to get a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To concatenate values into strings in a datastep use one of the many CAT....() functions.&lt;/P&gt;
&lt;P&gt;For example if you had five variables named VAR1 to VAR5 and you wanted to make a comma separated list of the values you could use.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;catx(',',of var1-var5)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Oct 2017 03:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-list-of-values/m-p/400080#M96964</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-01T03:27:26Z</dc:date>
    </item>
  </channel>
</rss>

