<?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: proc lua - submit macro variable with period (bug or feature?) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527271#M73574</link>
    <description>indeed - this approach will handle nested quotes, and long values, unlike the `submit` approach.   Thanks!</description>
    <pubDate>Tue, 15 Jan 2019 12:30:46 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2019-01-15T12:30:46Z</dc:date>
    <item>
      <title>proc lua - submit macro variable with period (bug or feature?)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527248#M73570</link>
      <description>&lt;P&gt;I tried running the following code today:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mapping_table=work.config;
proc lua restart;
submit "mapping_table=&amp;amp;mapping_table" ;
  print(mapping_table)
endsubmit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which resulted in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: SUBMIT block:1: attempt to index global 'work' (a nil value)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Removing the period (.) resolves the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this a bug?&amp;nbsp; Or a feature?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE id="pre_sasLog_93" class="sasLog"&gt;SYSVLONG=9.04.01M3P062415&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 09:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527248#M73570</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-01-15T09:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc lua - submit macro variable with period (bug or feature?)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527256#M73571</link>
      <description>&lt;P&gt;Try using single quotes around the macro variable in the SUBMIT statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; mapping_table&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;work&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;config&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; lua restart&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
submit &lt;SPAN class="token string"&gt;"mapping_table='&amp;amp;mapping_table'"&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;mapping_table&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
endsubmit&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 10:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527256#M73571</guid>
      <dc:creator>rhale</dc:creator>
      <dc:date>2019-01-15T10:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc lua - submit macro variable with period (bug or feature?)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527260#M73572</link>
      <description>The bug was in my brain..  Of course, when creating a lua variable, it needs a type - so strings must be quoted (else they will be interpreted as a variable name)</description>
      <pubDate>Tue, 15 Jan 2019 10:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527260#M73572</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-01-15T10:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc lua - submit macro variable with period (bug or feature?)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527269#M73573</link>
      <description>&lt;P&gt;Another (more reliable) approach is to use sas.symput function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mapping_table=work.config;
proc lua restart;
submit;
  mapping_table = sas.symget('mapping_table')
  print(mapping_table)
endsubmit;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jan 2019 12:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527269#M73573</guid>
      <dc:creator>sspkmnd</dc:creator>
      <dc:date>2019-01-15T12:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc lua - submit macro variable with period (bug or feature?)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527271#M73574</link>
      <description>indeed - this approach will handle nested quotes, and long values, unlike the `submit` approach.   Thanks!</description>
      <pubDate>Tue, 15 Jan 2019 12:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-lua-submit-macro-variable-with-period-bug-or-feature/m-p/527271#M73574</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-01-15T12:30:46Z</dc:date>
    </item>
  </channel>
</rss>

