title: How to conditionally define a macro-variable inside proc iml?
body: <p>I have an issue with combining <code>proc iml</code>, <code>if/then</code> and <code>call symputx</code>. If I run the following code :</p>
  
  <pre><code>proc iml;
  
  call symputx("noif",3);
  a=1;
  b=&amp;noif;                              /* 1) : works*/
  if a=1 then call symputx("withif",1);
  if a=1 then print a;                  /* 2) : works */
  c=&amp;withif;                            /* 3) : doesn't work */
  quit;
  %put &amp;withif;                         /* 4) : works */
  </code></pre>
  
  <ul>
  <li><p>1) working (and SAS/IML documentation) show I can use <code>call symputx</code>in <code>proc IML</code></p></li>
  <li><p>2) working (and SAS/IML documentation) show I can use <code>if/then</code>in <code>proc IML</code></p></li>
  <li><p>3) not working must therefore be due to some issue in combining the three statements.</p></li>
  <li><p>But 4) working shows the <code>call symputx("withif",1)</code> was somehow understood.</p></li>
  </ul>
  
  <p>What is the proper way to conditionally define a macro-variable inside <code>proc iml</code> ?</p>