title: SAS Calling ProcSQL-Macro in Data Step
body: <p>I cannot run my PROC SQL function by calling the macro in my Data step.
  The SQL function alone works, but I need to let it run for every Security Group.</p>
  
  <pre><code>%macro adding;
          proc sql;
          insert into have (Time,seconds) values
          ("9:10:00"t,33000);
          insert into have (Time,seconds) values
          ("16:50:00"t,60600);
          quit;
  %mend;
  
  data have;
  set have;
  by security;
  if first.security then %adding;
  if seconds=33000 then date=lag(date);
  if seconds=60600 then date=lag(date);
  run;
  </code></pre>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>1      proc sql;         insert into have (Time,seconds)
    values</p>
    
    <h2>       ----              ------</h2>
    
    <hr>
  
  <pre><code>   180               180 180 180 1   ! ("9:10:00"t,33000);         insert into have (Time,seconds) values 1   !
  </code></pre>
    
    <p>("16:50:00"t,60600);         quit; ERROR 180-322: Statement is
    not valid or it is used out of proper order.</p>
  </blockquote>
  
  <p>I don't know what to change that I can use it...</p>
  
  <p>Thankful for any help! Best</p>