<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic proc export with labels, but not working with the label statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-export-with-labels-but-not-working-with-the-label-statement/m-p/924622#M363938</link>
    <description>&lt;P&gt;I have a dataset with labels that I want to export to excel, but the label statement won't turn blue or export the label. 'About SAS 9' indicates I have SAS 9.4 TS Level 1M5, so the label statement should work... putnames doesn't work either. I tried to rename the variable itself, but they contain special characters (e.g. #). How can I export the dataset to excel with labels?&lt;/P&gt;&lt;PRE&gt;proc export 
	data=missingReport 
	outfile="C:location\filename.xlsx" 
	dbms=xlsx
	label replace;
	sheet="missingFacilities";
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Apr 2024 00:23:26 GMT</pubDate>
    <dc:creator>orchid_sugar</dc:creator>
    <dc:date>2024-04-17T00:23:26Z</dc:date>
    <item>
      <title>proc export with labels, but not working with the label statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-export-with-labels-but-not-working-with-the-label-statement/m-p/924622#M363938</link>
      <description>&lt;P&gt;I have a dataset with labels that I want to export to excel, but the label statement won't turn blue or export the label. 'About SAS 9' indicates I have SAS 9.4 TS Level 1M5, so the label statement should work... putnames doesn't work either. I tried to rename the variable itself, but they contain special characters (e.g. #). How can I export the dataset to excel with labels?&lt;/P&gt;&lt;PRE&gt;proc export 
	data=missingReport 
	outfile="C:location\filename.xlsx" 
	dbms=xlsx
	label replace;
	sheet="missingFacilities";
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Apr 2024 00:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-export-with-labels-but-not-working-with-the-label-statement/m-p/924622#M363938</guid>
      <dc:creator>orchid_sugar</dc:creator>
      <dc:date>2024-04-17T00:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc export with labels, but not working with the label statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-export-with-labels-but-not-working-with-the-label-statement/m-p/924626#M363940</link>
      <description>&lt;P&gt;Works fine for me:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
  set sashelp.class;
  label name='Student Name';
run;

proc export label data=class dbms=xlsx
  file='c:\downloads\labels.xlsx' replace;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1713314565915.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95613i319999048A873D95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1713314565915.png" alt="Tom_0-1713314565915.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure to attach the labels BEFORE the PROC EXPORT step.&lt;/P&gt;
&lt;P&gt;You don't have to make a copy of the dataset, you can use PROC DATASETS to modify the labels without copying the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the variable names do not meet SAS naming rules then you will need to use name literals in the LABEL statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;label 'job#'n ='Job Number';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Apr 2024 00:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-export-with-labels-but-not-working-with-the-label-statement/m-p/924626#M363940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-17T00:45:35Z</dc:date>
    </item>
  </channel>
</rss>

