title: Using macro variables in datastep arguments
body: <p>I'm trying to write tiny programm with parameters to backup datasets <em>(name+date+time)</em> in Enterprise Guide. Here's code:</p>
  <pre><code>data &amp;WhatLib..&amp;WhatTable%str(_)&amp;SYSDATE.%sysfunc(tranwrd(%str(&amp;SYSTIME.),:,_)) ;
  set &amp;WhatLib..&amp;WhatTable ;
  run;
  </code></pre>
  <p><code>WhatLib</code><em>(default value work)</em> and <code>WhatTable</code><em>(default value _PRODSAVAIL)</em> - parameters. Well, I get result, that in the screenshot:</p>
  <p><a href="https://i.stack.imgur.com/068mp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/068mp.png" alt="first version of code result" /></a></p>
  <p>I added a few more strings to check macro variables values:</p>
  <pre><code>%put &amp;WhatLib..&amp;WhatTable%str(_)&amp;SYSDATE.%sysfunc(tranwrd(%str(&amp;SYSTIME.),:,_));
  %put &amp;WhatLib..&amp;WhatTable;
  </code></pre>
  <p>And result is in log was:</p>
  <blockquote>
  <p>work._PRODSAVAIL_22AUG1613_28</p>
  <p>work._PRODSAVAIL</p>
  </blockquote>
  <p>Then, I wrapped this code into macro defenition:</p>
  <pre><code>%macro TEST();
  ...
  &lt;--same code--&gt;
  ...
  %mend TEST;
  
  %TEST();
  </code></pre>
  <p>But result were the same.
  I will be grateful if you specify an error or feature that I did not realize.</p>