title: Set the labels of a SAS Dataset equal to their variable name
body: <p>I'm working with a rather large several dataset that are provided to me as a CSV files.  When I attempt to import one of the files the data will come in fine but, the number of variables in the file is too large for SAS, so it stops reading the variable names and starts assigning them sequential numbers.  In order to maintain the variable names off of the data set I read in the file with the data row starting on 1 so it did not read the first row as variable names -</p>
  
  <pre><code>proc import file="X:\xxx\xxx\xxx\Extract\Live\Live.xlsx" out=raw_names dbms=xlsx replace;
      SHEET="live";
      GETNAMES=no;
      DATAROW=1;
  run;
  </code></pre>
  
  <p>I then run a macro to start breaking down the dataset and rename the variables based on the first observations in each variable -</p>
  
  <pre><code>%macro raw_sas_datasets(lib,output,start,end);
      data raw_names2;
          raw_names;
              if _n_ ne 1 then delete;
              keep A -- E &amp;start. -- &amp;end.;
      run;
      proc transpose data=raw_names2 out=raw_names2;
          var A -- &amp;end.;
      run;
      data raw_names2;
          set raw_names2;
              col1=compress(col1);
      run;
      data raw_values;
          set raw;
              keep A -- E &amp;start. -- &amp;end.;
      run;
      %macro rename(old,new);
          data raw_values;
              set raw_values;
                  rename &amp;old.=&amp;new.;
          run;
      %mend rename;
      data _null_;
          set raw_names2;
              call execute('%rename('||_name_||","||col1||")");
      run;
      %macro freq(var);
          proc freq data=raw_values noprint;
             tables &amp;var. / out=&amp;var.;
          run;
      %mend freq;
       data raw_names3;
          set raw_names2;
              if _n_ &lt; 6 then delete;
       run;
      data _null_;
          set raw_names3;
             call execute('%freq('||col1||")");
      run;
      proc sort data=raw_values;
          by StudySubjectID;
      run;
      data &amp;lib..&amp;output.;
          set raw_values;
      run;
  %mend raw_sas_datasets;
  </code></pre>
  
  <p>The problem I'm running into is that the variable names are now all set properly and the data is lined up correctly, but the labels are still the original SAS assigned sequential numbers. Is there any way to set all of the labels equal to the variable names?</p>