<?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 automatically rename of the ACROSS variables in Proc Report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272150#M58339</link>
    <description>&lt;P&gt;Depending on the actual statistics or manipulation maybe this approach gets you close.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data= sashelp.cars nway;
   where invoice ge 60000 ; 
   class make model type;
   var cylinders;
   output out = temp (drop=_:) max=;
run;

proc transpose data=temp out=want (drop=_name_);
     ;
   var cylinders   ;
   id type;
   by  make model;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Summary creates unique combinations of the NON-id variable and ID value would only occur once within each combination of the by variables. If your actual data /summarization is more complex then you need to provide an example with all of the complexities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2016 20:42:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-05-20T20:42:49Z</dc:date>
    <item>
      <title>How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272025#M58323</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;STRONG&gt;Hi there,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;STRONG&gt;if you run this proc report, the across variables in the output file will be called _C3_ _C4_ and _C5_&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;report&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Verdana" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;= sashelp.cars &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;nowd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Verdana" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;=alpha (drop=_break_ ) ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;column&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt; make model type, cylinders;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;define&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt; type / &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;across&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt; invoice ge &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;60000&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt; ; &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;Is there an option enabling SAS to rename the across variables as SUV Sedan and Sports&amp;nbsp;without having to&amp;nbsp;do it manually &lt;FONT face="Verdana" size="2"&gt;(drop=_break_&amp;nbsp; rename=(_C3_=SUV _C4_=SEDAN _C5_=SPORTS)) &lt;/FONT&gt;?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;&lt;FONT color="#000080" face="Verdana" size="2"&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 16:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272025#M58323</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2016-05-20T16:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272034#M58327</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about using Proc TRANSPOSE for this, then there is no need for renaming the columns. The ID statements defines the variable, where the content of the variable defines the name of the transposed column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.cars out=cars_s;
  where invoice ge 60000;
  by make model ;
run;

proc transpose 
  data=cars_s
  out=crs_trsp
;
  by make model;
  var cylinders;
  id type;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 16:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272034#M58327</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-20T16:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272094#M58336</link>
      <description>&lt;P&gt;Thanks but&amp;nbsp;an ID value&amp;nbsp;can occur multiple times and the proc transpose would not be possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, I would have to do a first proc report to group the variables&amp;nbsp;and get unique values in the ID, then transpose, then do&amp;nbsp;a second proc report to get the final table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 19:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272094#M58336</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2016-05-20T19:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272150#M58339</link>
      <description>&lt;P&gt;Depending on the actual statistics or manipulation maybe this approach gets you close.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data= sashelp.cars nway;
   where invoice ge 60000 ; 
   class make model type;
   var cylinders;
   output out = temp (drop=_:) max=;
run;

proc transpose data=temp out=want (drop=_name_);
     ;
   var cylinders   ;
   id type;
   by  make model;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Summary creates unique combinations of the NON-id variable and ID value would only occur once within each combination of the by variables. If your actual data /summarization is more complex then you need to provide an example with all of the complexities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 20:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272150#M58339</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-20T20:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272167#M58342</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the replies I got are telling me that there is no command in proc report that would do the job directly; it has to be in 2 steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 21:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272167#M58342</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2016-05-20T21:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272186#M58345</link>
      <description>&lt;P&gt;A part of the issue is that it would be VERY hard for Proc Report to do as you desire because you may have layered across variables which could very well result in multiple variables with the same 2nd level name. Currently you get col4-col6 partially because you can't repeat Cylinder as a name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be worth asking is the Proc Report more important or the Dataset? If the two are not "compatible" then generate the datastep separately. Let the computer do the routine and tedious repetitive work.&lt;/P&gt;
&lt;P&gt;I have stuff where I use Proc tabulate basically to create an output set then use Tabulate again to display the results after some manipulation for the final report that goes to the users.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 21:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272186#M58345</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-20T21:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically rename of the ACROSS variables in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272310#M58353</link>
      <description>Why do you want to this output? &lt;BR /&gt;How will you use it?</description>
      <pubDate>Sun, 22 May 2016 06:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-automatically-rename-of-the-ACROSS-variables-in-Proc/m-p/272310#M58353</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-05-22T06:30:21Z</dc:date>
    </item>
  </channel>
</rss>

