title: Assigning a macro variable value to a data step variable in SAS
body: <p>I am calling a macro inside a data step and assigning the macro variable to a data step variable as below.</p>
  
  <p>The input for the macro goes from the input dataset which has some 500 records.</p>
  
  <pre><code>%macro test(inp_var);
    %global macro_var;
    --- using inp_var variable here---
    %if --some condition-- %then call symput('macro_var',-- some value--);
  %mend;
  
  data output;
    set input;
    %test(inp_var);
    new_data_step_var = symget('macro_var');
  run;
  </code></pre>
  
  <p>But it's showing the error message pointing the variable <strong>new_data_step_var</strong> - <em>ERROR 180-322: Statement is not valid or it is used out of proper order</em>.</p>