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

Hi - I am able to achieve the following using proc report.

Capture.PNG

 

however what I want is as follows:

Capture2.PNG

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

move_summary_info.png

View solution in original post

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

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.

 

Cynthia_sas
SAS Super FREQ

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

move_summary_info.png

mduarte
Quartz | Level 8

@Cynthia_sas The merged cell option would have been perfect, but this solution will work.  Thank-you!

mduarte
Quartz | Level 8

@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).

ballardw
Super User

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.

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1136 views
  • 0 likes
  • 4 in conversation