BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
t_ar_taat
Quartz | Level 8

In the proc report and with group keyword, variable that follow the same value can be  displayed only at the first observation, but is there an option specification that displays "last" instead of "first"?

For example with this SAS official blog,

 

"Canada", "Pacific" of the region subject to the group keyword are displayed on the first line of the group.

Normal group displays Like this.


normal_group.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

proc report data=shoes nowd;
title 'REPORT Default Behavior';
  column region subsidiary product,(sales sales=savg);
 
  define region / group 
         style(column)=Header;
  define subsidiary / group
         style(column)=Header;
  define product / across 'Product Sales';
  define sales / sum 'Sum' f=dollar10.;
  define savg / mean 'Mean' f=dollar10.;
  rbreak after / summarize style=Header;
run;
 

What I want is like this.Look position of Canada and Pacific.

normal_group - コピー.png

Please let me know the option / technique to display like this.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
You need to change the vertical adjustment to "bottom" in order to change the position of the text in the spanning row cell. So you will need to change the VJUST attribute, as shown in this code.
cynthia

 

proc sort data=sashelp.shoes out=shoes;
by region subsidiary product;
where region in ('Canada' 'Pacific') and
      product contains 'Casual';
run;
  
proc report data=shoes nowd spanrows;
title 'VJUST=M';
  column region subsidiary product,(sales sales=savg);
 
  define region / group 
         style(column)=Header{vjust=m};
  define subsidiary / group
         style(column)=Header;
  define product / across 'Product Sales';
  define sales / sum 'Sum' f=dollar10.;
  define savg / mean 'Mean' f=dollar10.;
  rbreak after / summarize style=Header;
run;

proc report data=shoes nowd spanrows;
title 'VJUST=B';
  column region subsidiary product,(sales sales=savg);
 
  define region / group 
         style(column)=Header{vjust=b};
  define subsidiary / group
         style(column)=Header;
  define product / across 'Product Sales';
  define sales / sum 'Sum' f=dollar10.;
  define savg / mean 'Mean' f=dollar10.;
  rbreak after / summarize style=Header;
run;
 
 

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:
You need to change the vertical adjustment to "bottom" in order to change the position of the text in the spanning row cell. So you will need to change the VJUST attribute, as shown in this code.
cynthia

 

proc sort data=sashelp.shoes out=shoes;
by region subsidiary product;
where region in ('Canada' 'Pacific') and
      product contains 'Casual';
run;
  
proc report data=shoes nowd spanrows;
title 'VJUST=M';
  column region subsidiary product,(sales sales=savg);
 
  define region / group 
         style(column)=Header{vjust=m};
  define subsidiary / group
         style(column)=Header;
  define product / across 'Product Sales';
  define sales / sum 'Sum' f=dollar10.;
  define savg / mean 'Mean' f=dollar10.;
  rbreak after / summarize style=Header;
run;

proc report data=shoes nowd spanrows;
title 'VJUST=B';
  column region subsidiary product,(sales sales=savg);
 
  define region / group 
         style(column)=Header{vjust=b};
  define subsidiary / group
         style(column)=Header;
  define product / across 'Product Sales';
  define sales / sum 'Sum' f=dollar10.;
  define savg / mean 'Mean' f=dollar10.;
  rbreak after / summarize style=Header;
run;
 
 
t_ar_taat
Quartz | Level 8

Hi,Cynthia

 

Thank you so much !!

It worked very good! 

 

Sincerely,t_ar_taat

group_bottom.png

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 819 views
  • 0 likes
  • 2 in conversation