<?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: Macro keyword parameters not resolving (Please Help) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-keyword-parameters-not-resolving-Please-Help/m-p/311882#M67531</link>
    <description>&lt;P&gt;Is your endrsubmit early?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to compile the macro and macro variables in the same location - both locally or both on the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your macro variable can't have quotes though, otherwise the code generated is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;MMYY resolves to -&amp;gt; '102016'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2"&gt;PROC IMPORT OUT=tpt_lvt_his_&amp;amp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;MMYY. becomes&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2"&gt;PROC IMPORT OUT=tpt_lvt_his_&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;'102016'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000000"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;This isn't valid SAS sytnax.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000000"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;The code becomes simpler though:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;%let MON01=%sysfunc(intnx(MONTH,%sysfunc(today()),-1),mmyyn6.);&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2016 23:52:59 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-15T23:52:59Z</dc:date>
    <item>
      <title>Macro keyword parameters not resolving (Please Help)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-keyword-parameters-not-resolving-Please-Help/m-p/311879#M67529</link>
      <description>&lt;P&gt;Hello Forum,&lt;/P&gt;&lt;P&gt;I'm trying to create a macro that will import 12 months worth of data from 12 separate files.&amp;nbsp; I receive error messages that symbolic reference MTH01 and MON01 cannot resolve.&amp;nbsp; I also receive an error 22-322: syntax error, expecting one of the following: ;, (, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT....etc.&amp;nbsp; I thought that a macro previously defined in a program could later be invoked within a macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please tell me what I'm doing wrong or what I can do to correct this?&amp;nbsp; Thank you very much in advance.&lt;/P&gt;&lt;P&gt;~ Eric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; MTH01=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(dequote("'%sysfunc(intnx(MONTH,%sysfunc(today()),-1),monyy7.)'"));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&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; MON01=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%sysfunc&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;(dequote("'%sysfunc(intnx(MONTH,%sysfunc(today()),-1),mmyyn6.)'"));&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;&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; import(MONYY=,MMYY=);&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;PROC IMPORT OUT=tpt_lvt_his_&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;MMYY.&lt;/FONT&gt;&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;DATAFILE= &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"\\xxxxxxx\xxxxxxx\xxxxx\xxxx\xxxxx\xxxx\&amp;amp;MONYY.\TPT_ora_apples_&amp;amp;MMYY. (from&amp;nbsp;zzz Sharepoint).xls"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;DBMS=EXCEL REPLACE;&lt;/P&gt;&lt;P&gt;GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES;&lt;/P&gt;&lt;P&gt;RUN;&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;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&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;%&lt;STRONG&gt;&lt;I&gt;import&lt;/I&gt;&lt;/STRONG&gt; (MONYY=&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;MTH01.&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;,MMYY=&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;MON01.&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;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 23:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-keyword-parameters-not-resolving-Please-Help/m-p/311879#M67529</guid>
      <dc:creator>esvenson</dc:creator>
      <dc:date>2016-11-15T23:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro keyword parameters not resolving (Please Help)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-keyword-parameters-not-resolving-Please-Help/m-p/311882#M67531</link>
      <description>&lt;P&gt;Is your endrsubmit early?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to compile the macro and macro variables in the same location - both locally or both on the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your macro variable can't have quotes though, otherwise the code generated is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;MMYY resolves to -&amp;gt; '102016'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2"&gt;PROC IMPORT OUT=tpt_lvt_his_&amp;amp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;MMYY. becomes&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;&lt;FONT face="Courier New" size="2"&gt;PROC IMPORT OUT=tpt_lvt_his_&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;'102016'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000000"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;This isn't valid SAS sytnax.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000000"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;The code becomes simpler though:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;%let MON01=%sysfunc(intnx(MONTH,%sysfunc(today()),-1),mmyyn6.);&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 23:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-keyword-parameters-not-resolving-Please-Help/m-p/311882#M67531</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-15T23:52:59Z</dc:date>
    </item>
  </channel>
</rss>

