title: Dynamize range of SAS PROC SQL SELECT INTO macro creation
body: <p>I want to put multiple observations into an own macro variable. I would do this by using select into :obs1 - :obs4, however, as count of observations can differ, i would like to dynamize the range and my code looks like this:</p>
  
  <pre><code>proc sql;
      create table segments as select distinct substr(name,1,6) as segment from dictionary.columns
      where libname = 'WORK' and memname = 'ALL_CCFS' and name ne 'MONTH';
  run;
  
  proc sql noprint;
      select count(*) into: count from segments;
  run;
  
  proc sql noprint;
      select segment into :segment_1 - :segment_&amp;count. from dictionary.columns;
  run;
  </code></pre>
  
  <p>However, this doesn't seem to work... any suggestions? Thank you!</p>