<?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 Re: How to change column label to column name? Thanks. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845126#M36784</link>
    <description>&lt;P&gt;It kind of looks like from that picture that the label has a space in it.&amp;nbsp; That will not work well as a variable name.&amp;nbsp; Either it will be invalid, or it you set the VALIDVARNAME option to ANY then it will require that you use a name literal to reference it.&amp;nbsp; I would suggest either replacing the space with an underscore or using CaMeL case to mark the starts of new words in the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And to the general case a label can be up to 256 bytes long and a name can only be up to 32 bytes long.&amp;nbsp; So you cannot always use the label as a name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do want to change the name use the RENAME statement (or perhaps the RENAME= dataset option).&lt;/P&gt;
&lt;P&gt;If you want to change the label use the LABEL statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  rename ibesname=CompanyName ;
  label ibesname='IBES Name' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2022 15:01:03 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-11-18T15:01:03Z</dc:date>
    <item>
      <title>How to change column label to column name? Thanks.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845105#M36782</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beewise_0-1668779208236.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77442i871E515FCABE13CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beewise_0-1668779208236.png" alt="beewise_0-1668779208236.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 13:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845105#M36782</guid>
      <dc:creator>beewise</dc:creator>
      <dc:date>2022-11-18T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change column label to column name? Thanks.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845106#M36783</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets library=work nolist; /* or if it is not a WORK data set, use the appropriate libname instead of work */
    modify datasetname;
    rename ibesname=company_name;
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 14:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845106#M36783</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-18T14:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change column label to column name? Thanks.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845126#M36784</link>
      <description>&lt;P&gt;It kind of looks like from that picture that the label has a space in it.&amp;nbsp; That will not work well as a variable name.&amp;nbsp; Either it will be invalid, or it you set the VALIDVARNAME option to ANY then it will require that you use a name literal to reference it.&amp;nbsp; I would suggest either replacing the space with an underscore or using CaMeL case to mark the starts of new words in the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And to the general case a label can be up to 256 bytes long and a name can only be up to 32 bytes long.&amp;nbsp; So you cannot always use the label as a name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do want to change the name use the RENAME statement (or perhaps the RENAME= dataset option).&lt;/P&gt;
&lt;P&gt;If you want to change the label use the LABEL statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  rename ibesname=CompanyName ;
  label ibesname='IBES Name' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 15:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-column-label-to-column-name-Thanks/m-p/845126#M36784</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-18T15:01:03Z</dc:date>
    </item>
  </channel>
</rss>

