<?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 many characters are in my variable name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731266#M227794</link>
    <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select name
from sashelp.vcolumn
where libname="SASHELP" and memname="CARS" and length(name)&amp;gt;10;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 04 Apr 2021 17:53:45 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2021-04-04T17:53:45Z</dc:date>
    <item>
      <title>How many characters are in my variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731260#M227793</link>
      <description>&lt;P&gt;I am running a lot of variables through a macro which is using the variable name to create temp dataset names. Some of my var names are too long resulting in an error when the macro can't create the dataset (too many characters). Is there an easy way to count how many characters are in my variable names so I can identify any that are longer than 25 characters in order to rename them prior to running them through the macro? I don't need help in renaming them - I just want the count of characters in each variable name. I have about 100 variables to check in total so it would be helpful to not do this manually if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples variable names are:&lt;/P&gt;&lt;P&gt;Idx1base_Azole_antifungals&lt;BR /&gt;mon_all_chemo_supp_std_cost1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and macro wants to use the var name like this:&lt;/P&gt;&lt;P&gt;data chisq_&amp;amp;var.;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 04 Apr 2021 17:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731260#M227793</guid>
      <dc:creator>efarrelly</dc:creator>
      <dc:date>2021-04-04T17:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: How many characters are in my variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731266#M227794</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select name
from sashelp.vcolumn
where libname="SASHELP" and memname="CARS" and length(name)&amp;gt;10;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Apr 2021 17:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731266#M227794</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-04-04T17:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: How many characters are in my variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731270#M227795</link>
      <description>&lt;P&gt;If you have a macro variable named VAR you can use the %LENGTH() macro function to find out how long it is.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %length(&amp;amp;var) &amp;gt; 25 %then %do;
  %put Variable name &amp;amp;VAR is too long.
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Apr 2021 18:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-many-characters-are-in-my-variable-name/m-p/731270#M227795</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-04T18:33:15Z</dc:date>
    </item>
  </channel>
</rss>

