DATA Step, Macro, Functions and more

Sum in proc print

Reply
Frequent Contributor
Posts: 149

Sum in proc print

Hi, 

I have this issue with proc print. I'm trying to have the value "Total" in the last cell of study_name column. 

I tried the  grandtotal_label='Total' option but it shows the value in the obs column. 

I don't want to use proc report 

 

data have;
input study_name $ June July August;
datalines;
A 20 16 39
B 18 18 6
C 19 1 5
D 87 65 115
E 63 55 62
F 81 104 87
G 73 19 49
H 189 69 79
I 28 6 8
J 87 83 52
K 0 0 0
L 0 0 0
M 4 1 1
N 1 0 2
O 212 159 304
;

proc print data=have grandtotal_label='Total' label ;
sum June July August;
label study_name="Study";
run;

Capture1234.PNG

Super User
Super User
Posts: 9,407

Re: Sum in proc print

"I don't want to use proc report " - why not?  Proc report does this, use it.  Its much like saying I only want to use a mouse to type this letter, you can do it, by why?

 

Anyways:

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002262174.htm

Ask a Question
Discussion stats
  • 1 reply
  • 53 views
  • 2 likes
  • 2 in conversation