<?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 with ACROSS option in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538870#M74059</link>
    <description>&lt;P&gt;Thanks, Cynthia!&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 02:04:28 GMT</pubDate>
    <dc:creator>Coooooo_Lee</dc:creator>
    <dc:date>2019-02-27T02:04:28Z</dc:date>
    <item>
      <title>proc report with ACROSS option</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538619#M74046</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question regards to ACROSS option in PROC REPORT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some modification on sashelp.class as an example.&lt;/P&gt;&lt;P&gt;Please run below code to get the dataset and report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to only change the column width of column "Height"?&lt;/P&gt;&lt;P&gt;How to give a different width for val under the last ACROSS option.&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;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table class as 
	select a.*, ifc(age ge 13, '&amp;gt;=13' , '&amp;lt;13') as age_grp ,'Weight' as ept
	from sashelp.class(drop=height rename=(weight=val)) as a 
	union
	select b.*, ifc(age ge 13, '&amp;gt;=13' , '&amp;lt;13') as age_grp, 'Height' as ept
	from sashelp.class(drop=weight rename=(height=val)) as b;
quit;



proc report data=class  nowd headline headskip split='\' spacing=2 missing ;


  	column   name  age_grp,Sex,ept,val  dummy;

	define name/group;

  	define age_grp/'' across order=data ;
  	define Sex/'' across order=data ;
  	define ept/ '' across order=data  width=10;
  	define val/'' display left  width=6;
  	define dummy/ noprint;

    compute dummy;     
	  dummy = 1;   
    endcomp;
  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 12:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538619#M74046</guid>
      <dc:creator>Coooooo_Lee</dc:creator>
      <dc:date>2019-02-26T12:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with ACROSS option</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538691#M74050</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You mean like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diff_width_under_across.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27503i92B0796500A5CC04/image-size/large?v=v2&amp;amp;px=999" role="button" title="diff_width_under_across.png" alt="diff_width_under_across.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It is far easier than your approach. You do NOT need to perform the manipulations in the DATA step that you did. Just a simple user-defined format for AGE. Then you can have numeric variables HEIGHT and WEIGHT under AGE and SEX as ACROSS items. Which means that you can use a simple STYLE(COLUMN) override for width, as shown below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value agef low-12 = '&amp;lt;13'
        13-high='&amp;gt;=13';
run;

proc report data=sashelp.class  nowd split='\' missing ;
  title 'Across';
  	column name  age,Sex,(height weight);
	define name/group  ;
  	define age /'' across order=data f=agef.;
  	define Sex/'' across order=data ;
  	define height/   sum style(column)={cellwidth=1.5in} ;
  	define weight/  sum style(column)={cellwidth=.5in};
  	define dummy/ noprint;
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; With this approach, the values for HEIGHT and WEIGHT each have their own DEFINE statement, so it is easy to alter the width.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I did change your code, you didn't need the DUMMY variable and in addition, I eliminated the LISTING only options, like HEADLINE and HEADSKIP and SPACING.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:26:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538691#M74050</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-02-26T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc report with ACROSS option</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538870#M74059</link>
      <description>&lt;P&gt;Thanks, Cynthia!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 02:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-with-ACROSS-option/m-p/538870#M74059</guid>
      <dc:creator>Coooooo_Lee</dc:creator>
      <dc:date>2019-02-27T02:04:28Z</dc:date>
    </item>
  </channel>
</rss>

