title: SAS do loop macro
body: <p>I'm trying to get this macro with a do loop to work. Seems straightforward by it doesn't populate the new fields with anything. Please any help is appreciated. An array doesn't seem work as my data is all in columns. Thanks!</p>
  
  <pre><code>%macro labs;
  data lab1;
  set non1;
  by record_id;
  %do i=1 %to 25;
  length lab_spec_type_&amp;i $25.;
  %if lab_spec_site&amp;i = '2' %then lab_spec_type_&amp;i = 'matser';
  %else %if lab_spec_site&amp;i = '1' %then lab_spec_type_&amp;i = 'matbl';
  %end;
  %mend;
  %labs;
  </code></pre>