Hi - I am able to achieve the following using proc report.
however what I want is as follows:
i.e, I want the total active to appear as a summary line below the type_label columns.
The code I have to date is below:
DATA WORK.saseg;
INFILE DATALINES DLM=',' MISSOVER DSD ;
INPUT
CumFrequency : BEST32.
type : $CHAR6.
description : $CHAR6.
type_label : $CHAR16.
total_visits : BEST32.
variable : $CHAR11. ;
DATALINES;
2294,period,Area 1,Reporting Period,191,23 (1)
2294,period,Area 2,Reporting Period,38,13 (0.6)
2294,period,Area 3,Reporting Period,263,105 (4.6)
2294,period,Area 4,Reporting Period,31,2 (0.1)
2294,period,Area 5,Reporting Period,69,63 (2.7)
2294,period,Area 6,Reporting Period,2488,1065 (46.4)
2294,period,Area 7,Reporting Period,7,0 (0)
3400,ytd,Area 1,YTD,486,62 (1.8)
3400,ytd,Area 2,YTD,128,58 (1.7)
3400,ytd,Area 3,YTD,654,40 (1.2)
3400,ytd,Area 4,YTD,73,4 (0.1)
3400,ytd,Area 5,YTD,224,50 (1.5)
3400,ytd,Area 6,YTD,6426,417 (12.3)
3400,ytd,Area 7,YTD,11,1 (0)
;
proc report data= saseg;
column description type_label , (variable total_visits cumfrequency);
define description / group;
define type_label /across ;
define variable / center;
define cumfrequency /mean ;
format total_visits comma12.0 cumfrequency comma12.;
label cumfrequency='Total Active' description='Variable of Interest' eft = 'No.(%)' total_visits='Total Visits' type_label='Visiting ...';
run;
Any help will be much appreciated.
Thanks,
Marie
Hi:
As explained, you can't do the merged cells, but you can put a summary line and move the Total Active under one of the other 2 columns on the row.
See the example below.
cynthia
You can't really change columns spans (except to creata full line), nor display unrelated values in a given column unless it is a computed column afaik.
Also your code is hard to use.
Hi:
As explained, you can't do the merged cells, but you can put a summary line and move the Total Active under one of the other 2 columns on the row.
See the example below.
cynthia
@Cynthia_sas The merged cell option would have been perfect, but this solution will work. Thank-you!
@ChrisNZ Thanks - I didn't realise the original code I entered had been formatted on one line.. the editing block showed each statement on its own line. Anyway I copied it, pasted it into notepad and pasted it back here and now seems to display a bit better ... ( I believe).
The code box with {i} is better for plain text though I've had that jumble things a couple of times. The "Run" icon accepts some formatting codes and as such one in awhile the seems to miss the "start" or "end" of something tag in a copy/paste.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.