<?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 SQL within Macro error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311382#M67281</link>
    <description>&lt;P&gt;You will need to use the &lt;A href="http://support.sas.com/documentation/cdl/en/connref/67933/HTML/default/viewer.htm#n1bc4zi0lp02ivn1oxn9gc1bsaha.htm" target="_blank"&gt;%syslput&lt;/A&gt; macro statement to transfer the values to the remote session.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2016 12:31:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-11-14T12:31:48Z</dc:date>
    <item>
      <title>Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311380#M67280</link>
      <description>&lt;P&gt;I'm trying to run some proc sql within a macro and SAS won't recognise my macro variables.&amp;nbsp; What am I doing wrong...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sixmonthroll(startdate,longstart,longend);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;rsubmit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;proc sql;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;create table &amp;amp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;startdate.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; as&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;etc.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;etc.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;quit;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;endrsubmit;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%&lt;STRONG&gt;&lt;I&gt;sixmonthroll&lt;/I&gt;&lt;/STRONG&gt; (jan16,jan_2016,jul_2016);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;When I run the code above I get the following error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;224 %sixmonthroll (jan16,jan_2016,jul_2016);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Remote submit to HOST commencing.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;491 proc sql;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;492 create table &amp;amp;startdate. as select &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="courier new,courier"&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; -&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="courier new,courier"&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; 22&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="courier new,courier"&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; 200&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="courier new,courier"&gt;WARNING: Apparent symbolic reference STARTDATE not resolved.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="courier new,courier"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.&lt;/FONT&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 12:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311380#M67280</guid>
      <dc:creator>cstanyer</dc:creator>
      <dc:date>2016-11-14T12:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311382#M67281</link>
      <description>&lt;P&gt;You will need to use the &lt;A href="http://support.sas.com/documentation/cdl/en/connref/67933/HTML/default/viewer.htm#n1bc4zi0lp02ivn1oxn9gc1bsaha.htm" target="_blank"&gt;%syslput&lt;/A&gt; macro statement to transfer the values to the remote session.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 12:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311382#M67281</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-14T12:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311385#M67282</link>
      <description>&lt;P&gt;&amp;nbsp;I wondered if it was something to do with that.&amp;nbsp; I've not used &lt;A href="http://support.sas.com/documentation/cdl/en/connref/67933/HTML/default/viewer.htm#n1bc4zi0lp02ivn1oxn9gc1bsaha.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;%syslput&lt;/A&gt; before- I'll look into it, thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 12:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311385#M67282</guid>
      <dc:creator>cstanyer</dc:creator>
      <dc:date>2016-11-14T12:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311389#M67284</link>
      <description>&lt;P&gt;While macro statements like %let or %put or %if...%then...%else are executed locally, macro variable references are transferred to the remote session "as is" and resolved there, so one needs to create the macro variables in the remote session before using them.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 12:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311389#M67284</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-14T12:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311391#M67285</link>
      <description>Could I move the rsubmits from within the macro code and rsubmit the %sixmonthroll instead?</description>
      <pubDate>Mon, 14 Nov 2016 12:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311391#M67285</guid>
      <dc:creator>cstanyer</dc:creator>
      <dc:date>2016-11-14T12:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311395#M67287</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114926"&gt;@cstanyer&lt;/a&gt; wrote:&lt;BR /&gt;Could I move the rsubmits from within the macro code and rsubmit the %sixmonthroll instead?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That would only work if you also defined the macro remotely:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rsubmit;
%macro testmac(parameters);
/* statements */
%mend;
%testmac(params);
endrsubmit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 13:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311395#M67287</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-14T13:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL within Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311442#M67305</link>
      <description>&lt;P&gt;That's what I did.&amp;nbsp; Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-within-Macro-error/m-p/311442#M67305</guid>
      <dc:creator>cstanyer</dc:creator>
      <dc:date>2016-11-14T15:54:36Z</dc:date>
    </item>
  </channel>
</rss>

