title: calculation inside char value
body: <p>I have string value like &quot;<em>some text {5+1.5}</em>&quot;, and would like to calculate it inside data step. (This value is from column, but it doesn't matter).</p>
  <p>I have code, that was executed correctly but with errors inside macro. But if execute it without macro, there is no errors. I would like to execute it inside macro, how can i fix error? Without using <code>options NOERRORABEND NODMSSYNCHK NOSYNTAXCHECK;</code>. Algorithm is to change using <code>tranwrd</code> <code>&quot;{&quot;</code> to <code>&quot;%sysevalf(&quot;</code> and <code>&quot;}&quot;</code> to <code>&quot;)&quot;</code>.</p>
  <p><strong>CODE THAT WORK CORRECTLY, BUT THERE IS ERROR IN LOG:</strong></p>
  <pre><code>%macro t;
  data have_in_macro;
  %let value=%sysfunc(tranwrd(
                            %sysfunc(tranwrd(
                                          &quot;some text {5+1.5}&quot;,%str(}),%str(%))
                                )),%str({),%str(sysevalf)%str(%()
                  ));
  
                  %let value=%sysfunc(tranwrd(
                              %str(&amp;value),%str(sysevalf),%str(%%)%str(sysevalf)
                  ));
                  t=&amp;value;
  run;
  %mend t;
  
  %t;
  </code></pre>
  <p><strong>CODE THAT WORK CORRECTLY WITHOUT ERRORS, BUT WITHOUT USING MACRO:</strong></p>
  <pre><code>data have;
  %let value=%sysfunc(tranwrd(
                            %sysfunc(tranwrd(
                                          &quot;some text {5+1.5}&quot;,%str(}),%str(%))
                                )),%str({),%str(sysevalf)%str(%()
                  ));
  
                  %let value=%sysfunc(tranwrd(
                              %str(&amp;value),%str(sysevalf),%str(%%)%str(sysevalf)
                  ));
                  t=&amp;value;
  run;
  </code></pre>
  <p>INPUT:</p>
  <blockquote>
  <p>some text {5+1.5}</p>
  </blockquote>
  <p>OUTPUT:</p>
  <blockquote>
  <p>some text 6.5</p>
  </blockquote>
  <p>ERROR USING MACRO:</p>
  <blockquote>
  <p>ERROR: %SYSEVALF must be followed by an expression enclosed in
  parentheses.</p>
  </blockquote>
  <p><strong>P.S. This code is just sample to call error that i get using my algorithm calling <code>tranwrd</code>.</strong></p>