<?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 Report:  Across variable names in Out= dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69899#M20114</link>
    <description>Hi:&lt;BR /&gt;
  As Scott suggests, if all you need is an output dataset, you may want to use different techniques. If you want to stick with a PROC REPORT  technique, however, then your choice is to use the RENAME= option on the OUT= specification, as shown in the code below.&lt;BR /&gt;
 &lt;BR /&gt;
  PROC REPORT assigns absolute column numbers and only absolute column numbers to the variables it creates from ACROSS variable values -- so, you have to control the names if you do not want the absolute column numbers.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc report data=sashelp.shoes nowd &lt;BR /&gt;
            out=work.shoeout(rename=(_c2_=Asia _c3_=Canada _c4_=Pacific));&lt;BR /&gt;
    where region in ('Asia', 'Canada', 'Pacific');&lt;BR /&gt;
column product region,sales;&lt;BR /&gt;
define product / group;&lt;BR /&gt;
define region / across;&lt;BR /&gt;
define sales/sum;&lt;BR /&gt;
run;&lt;BR /&gt;
                                      &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=shoeout;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Tue, 08 Feb 2011 00:50:24 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-02-08T00:50:24Z</dc:date>
    <item>
      <title>Proc Report:  Across variable names in Out= dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69897#M20112</link>
      <description>I am using Proc Report with an ACROSS variable to create a new dataset in the OUT= option.  However, the variables in the new dataset that were created by the across variable do not have meaninful names.&lt;BR /&gt;
&lt;BR /&gt;
How can I make the new variable names = the value of the ACROSS variable?&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA = INITIAL_DATANOWD  OUT=NEW_DATA;&lt;BR /&gt;
	COLUMN ID MONTH,BALANCE;&lt;BR /&gt;
	DEFINE ID                /GROUP ;&lt;BR /&gt;
	DEFINE MONTH       /ACROSS  ;&lt;BR /&gt;
	DEFINE BALANCE   /SUM;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
New_data has variables:&lt;BR /&gt;
    Name = "_C2_", Label = MONTH&lt;BR /&gt;
    Name = "_C3_", Label = MONTH&lt;BR /&gt;
    Name = "_C4_", Label = MONTH&lt;BR /&gt;
    ...Etc&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Whereas I want New_data to have variables:&lt;BR /&gt;
    Name = "JAN"&lt;BR /&gt;
    Name = "FEB"&lt;BR /&gt;
    Name = "MAR"</description>
      <pubDate>Mon, 07 Feb 2011 20:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69897#M20112</guid>
      <dc:creator>ddeb</dc:creator>
      <dc:date>2011-02-07T20:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report:  Across variable names in Out= dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69898#M20113</link>
      <description>Have you considered PROC TRANSPOSE (using ID and IDLABEL statements) after using PROC SUMMARY, instead?  &lt;BR /&gt;
&lt;BR /&gt;
I do know of a SAS format MONNAME3.  which will display the three-character Month abbreviation, when referencing a SAS DATE type (numeric) variable.  Not sure if it would be suitable for your PROC REPORT code though.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 07 Feb 2011 22:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69898#M20113</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-02-07T22:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report:  Across variable names in Out= dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69899#M20114</link>
      <description>Hi:&lt;BR /&gt;
  As Scott suggests, if all you need is an output dataset, you may want to use different techniques. If you want to stick with a PROC REPORT  technique, however, then your choice is to use the RENAME= option on the OUT= specification, as shown in the code below.&lt;BR /&gt;
 &lt;BR /&gt;
  PROC REPORT assigns absolute column numbers and only absolute column numbers to the variables it creates from ACROSS variable values -- so, you have to control the names if you do not want the absolute column numbers.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc report data=sashelp.shoes nowd &lt;BR /&gt;
            out=work.shoeout(rename=(_c2_=Asia _c3_=Canada _c4_=Pacific));&lt;BR /&gt;
    where region in ('Asia', 'Canada', 'Pacific');&lt;BR /&gt;
column product region,sales;&lt;BR /&gt;
define product / group;&lt;BR /&gt;
define region / across;&lt;BR /&gt;
define sales/sum;&lt;BR /&gt;
run;&lt;BR /&gt;
                                      &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=shoeout;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 08 Feb 2011 00:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Across-variable-names-in-Out-dataset/m-p/69899#M20114</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-08T00:50:24Z</dc:date>
    </item>
  </channel>
</rss>

