<?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: Running macro with macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502555#M134169</link>
    <description>&lt;P&gt;Haha - trap for the young player!&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 00:16:35 GMT</pubDate>
    <dc:creator>DucatiJong</dc:creator>
    <dc:date>2018-10-09T00:16:35Z</dc:date>
    <item>
      <title>Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502545#M134162</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example below error-ed out. I believe I need to resolve my macro var before the datastep but not sure how. Could someone please advise how I can run this correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Test ( InputDS = L1DWP.CUSTOMER_DIM_&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;LAST_MONTH_YYYYMM.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;OutptDS = CUSTOMER_DIM_&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;LAST_MONTH_YYYYMM.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;data &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;OutptDS.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;set &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;InputDS.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (obs=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;Test&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 22:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502545#M134162</guid>
      <dc:creator>DucatiJong</dc:creator>
      <dc:date>2018-10-08T22:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502551#M134165</link>
      <description>&lt;P&gt;Your example is missing a comma, but not sure if that will solve your problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Test ( InputDS = L1DWP.CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM. ,
OutptDS = CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM.);
data &amp;amp;OutptDS.;
set &amp;amp;InputDS. (obs=10);
 
run;
%mend;
 
%Test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Oct 2018 23:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502551#M134165</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-10-08T23:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502552#M134166</link>
      <description>&lt;P&gt;Execute the command OPTIONS MPRINT; before you run the code. Then, show us the SASLOG so we can see the error message, by clicking the {i} icon and pasting the SASLOG into the window that appears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502552#M134166</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-10-09T00:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502554#M134168</link>
      <description>&lt;P&gt;1 %_eg_hidenotesandsource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nonotes;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nosource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options NOTES;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options SOURCE;&lt;/P&gt;&lt;P&gt;5 %_eg_hidenotesandsource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nonotes;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nosource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options NOTES;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options SOURCE;&lt;/P&gt;&lt;P&gt;28&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;30 options mprint;&lt;/P&gt;&lt;P&gt;31 %macro Test ( InputDS = L1DWP.CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM.&lt;/P&gt;&lt;P&gt;32 OutptDS = CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM.);&lt;/P&gt;&lt;P&gt;33&lt;/P&gt;&lt;P&gt;34 data &amp;amp;OutptDS.;&lt;/P&gt;&lt;P&gt;35 set &amp;amp;InputDS. (obs=10);&lt;/P&gt;&lt;P&gt;36 run;&lt;/P&gt;&lt;P&gt;37&lt;/P&gt;&lt;P&gt;38 %mend;&lt;/P&gt;&lt;P&gt;39&lt;/P&gt;&lt;P&gt;40 %Test;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference OUTPTDS not resolved.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the invoked macro "TEST".&lt;/P&gt;&lt;P&gt;40 data &amp;amp;OutptDS.;&lt;/P&gt;&lt;P&gt;_&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;200&lt;/P&gt;&lt;P&gt;MPRINT(TEST): data &amp;amp;OutptDS.;&lt;/P&gt;&lt;P&gt;MPRINT(TEST): set L1DWP.CUSTOMER_DIM_201808 OutptDS = CUSTOMER_DIM_201808 (obs=10);&lt;/P&gt;&lt;P&gt;MPRINT(TEST): run;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_.&lt;/P&gt;&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;NOTE: Compression was disabled for data set WORK.DATA22 because compression overhead would increase the size of the data set.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.DATA22 may be incomplete. When this step was stopped there were 0 observations and 0 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;user cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;system cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;memory 285.65k&lt;/P&gt;&lt;P&gt;OS Memory 19028.00k&lt;/P&gt;&lt;P&gt;Timestamp 10/09/2018 01:13:27 PM&lt;/P&gt;&lt;P&gt;Step Count 95 Switch Count 48&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "INPUTDS".&lt;/P&gt;&lt;P&gt;40 L1DWP.CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM. OutptDS = CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM.&lt;/P&gt;&lt;P&gt;_&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;76&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY,&lt;/P&gt;&lt;P&gt;KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.&lt;/P&gt;&lt;P&gt;2 The SAS System 10:36 Tuesday, October 9, 2018&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;41&lt;/P&gt;&lt;P&gt;42 %_eg_hidenotesandsource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nonotes;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nosource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options NOTES;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options SOURCE;&lt;/P&gt;&lt;P&gt;54&lt;/P&gt;&lt;P&gt;55&lt;/P&gt;&lt;P&gt;56 %_eg_hidenotesandsource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nonotes;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_HIDENOTESANDSOURCE): options nosource;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options NOTES;&lt;/P&gt;&lt;P&gt;MPRINT(_EG_RESTORENOTESANDSOURCE): options SOURCE;&lt;/P&gt;&lt;P&gt;59&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502554#M134168</guid>
      <dc:creator>DucatiJong</dc:creator>
      <dc:date>2018-10-09T00:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502555#M134169</link>
      <description>&lt;P&gt;Haha - trap for the young player!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502555#M134169</guid>
      <dc:creator>DucatiJong</dc:creator>
      <dc:date>2018-10-09T00:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502556#M134170</link>
      <description>&lt;P&gt;As stated by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;, your code is missing a comma. Please fix that, then run the code again and paste the SASLOG into the {i} window.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502556#M134170</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-10-09T00:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502560#M134171</link>
      <description>&lt;P&gt;Thanks. All good now.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502560#M134171</guid>
      <dc:creator>DucatiJong</dc:creator>
      <dc:date>2018-10-09T00:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running macro with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502961#M134330</link>
      <description>&lt;P&gt;That's why I always align code. You would have seen the issue right away if you were used to writing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%macro Test &lt;FONT size="3"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; InputDS = L1DWP.CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT size="3" color="#FF0000"&gt;,&lt;/FONT&gt; OutptDS = CUSTOMER_DIM_&amp;amp;LAST_MONTH_YYYYMM.&amp;nbsp; &amp;nbsp; &amp;nbsp; ); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; data &amp;amp;OutptDS.; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; set &amp;amp;InputDS. (obs=10); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; run; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%mend; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%Test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same for proc sql: commas first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 02:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-macro-with-macro-variable/m-p/502961#M134330</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-10T02:24:42Z</dc:date>
    </item>
  </channel>
</rss>

