<?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: PROC TABULATE in 9.4 M3 changes var name in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/265013#M57834</link>
    <description>&lt;P&gt;I would definitely contact tech support with this question, if you haven't already.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2016 06:28:46 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-04-20T06:28:46Z</dc:date>
    <item>
      <title>PROC TABULATE in 9.4 M3 changes var name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/265004#M57833</link>
      <description>&lt;P&gt;So I ran this little piece of code under SAS9.4 M0 and also under M3 and get a different name for the colpctsum variable!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;tabulate&lt;/STRONG&gt; data=sashelp.cars out=fred;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; var horsepower;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; class origin;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; table origin,horsepower*colpctsum;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under M0 the var name is: Horsepower_PctSum_0&lt;/P&gt;
&lt;P&gt;Under M3 the var name is: Horsepower_PctSum_0_Horsepower&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very unfortunate and is causing us a lot of grief!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anything in the release notes that refers to this new behaviour?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 05:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/265004#M57833</guid>
      <dc:creator>fred777</dc:creator>
      <dc:date>2016-04-20T05:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE in 9.4 M3 changes var name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/265013#M57834</link>
      <description>&lt;P&gt;I would definitely contact tech support with this question, if you haven't already.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 06:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/265013#M57834</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-20T06:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE in 9.4 M3 changes var name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/413054#M67435</link>
      <description>&lt;P&gt;We just upgraded from 9.4M2 to 9.4M4 and experienced the same column naming issue when using PROC TABULATE between versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know it has been a long time since this post was created but did you find anything out from tech support?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/413054#M67435</guid>
      <dc:creator>bstrac</dc:creator>
      <dc:date>2017-11-13T21:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE in 9.4 M3 changes var name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/413073#M67439</link>
      <description>&lt;P&gt;Here's &lt;A href="http://support.sas.com/kb/58/340.html" target="_self"&gt;a SAS note that describes the change&lt;/A&gt;.&amp;nbsp; It was intentional -- to help with name collisions.&amp;nbsp; But unfortunately it broke your process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More documentation/explanation &lt;A href="http://support.sas.com/kb/45/710.html" target="_self"&gt;in this Usage Note 45710: Naming convention for statistics in an output data set created by PROC TABULATE&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a brute-force SAS macro program -- which I dug out of a Tech Support track and which you should&amp;nbsp;&lt;STRONG&gt;definitely&lt;/STRONG&gt; test before using in production -- that renames the variables back to the old style, trimming the underscore-number suffix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro myrename(dsn=&amp;amp;syslast);
  %let lib=%scan(&amp;amp;syslast,1,%str(.));
  %let mem=%scan(&amp;amp;syslast,2,%str(.));
  proc sql  noprint;
  /* generate a command line : RENAME oldname=newname */
   select catt('rename',' '!!name,'=',substr(name,1,length(name)-index(reverse(trim(name)),'_'))) into:renamelist separated by ";"
   from sashelp.vcolumn where libname=upcase("&amp;amp;lib.") and memname=upcase("&amp;amp;mem.") and (lowcase(name) like '%_pctsum_%' OR lowcase(name) like '%_pctn_%' );
  /* execute this command in proc datasets */
  proc datasets lib=&amp;amp;lib nolist;    modify &amp;amp;mem;    &amp;amp;renamelist;  run;quit;
%mend myrename;
%myrename;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-in-9-4-M3-changes-var-name/m-p/413073#M67439</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-11-13T21:20:21Z</dc:date>
    </item>
  </channel>
</rss>

