Hi,
I am summing up *N* in my define statement but it does not work. attached the code and sample data.
options missing = "" ls=200; proc report data = DESC2_CAT030 nowd split = "¤" headline missing contents = "" out=DESC2_CAT030_rpt; column param=BV actarm=AV timevar = TV filler bnrind=A2N (' ' count=BN) anrind, ( count pctc ) dummy ; define param / group style(header)={just=left cellwidth=4.5cm} style(column)=IdColIndent2{asis=on} "" ; define actarm / group style(header)={just=left cellwidth=2cm} style(column)=IdColIndent2{asis=on} "Treatment Group"; define timevar /group style={just=right cellwidth=2cm} "Week" ; define bnrind / display style={just=left cellwidth=2.1cm} "Baseline Reference Range Indicator"; define A2N /group order=data style={just=left cellwidth=2.1cm} "Baseline Reference Range Indicator"; define filler /display style={just=left cellwidth=0.2cm} ""; define anrind /across order=data style={just=left} "Analysis Reference Range Indicator"; define dummy /computed noprint; define BN / analysis sum " N" style={just=right cellwidth=1.47499999999998cm} ; define count /analysis sum style={just=right cellwidth=1.47499999999998cm} "n"; define pctc /display style={just=right cellwidth=1.96666666666664cm} "(%)"; define BV /group style={just=right cellwidth=4.5cm} ""; define TV /group style={just=right cellwidth=2cm} "Week"; define AV /group style={just=right cellwidth=2cm} "Treatment Group"; compute before; line @1 ' '; Total=BN; endcomp; compute after timevar; TV=' '; AV=' '; BV=' '; A2N='N'; line ' '; endcomp; break after timevar / summarize; run;
while running the report i get multiple observations of N.
You still have a DISPLAY variable, so this is why you get individual lines. Check the log for "Groups are not created"
Define the filler var as
define filler /group style={just=left cellwidth=0.2cm} "";
and you should be ok
You still have a DISPLAY variable, so this is why you get individual lines. Check the log for "Groups are not created"
Define the filler var as
define filler /group style={just=left cellwidth=0.2cm} "";
and you should be ok
I am sure we have been over these things before. Do calculations in a datastep before the proc report, whilst report can do some basic stuff its really not a data processing procedure. There are a lot of oddities in what you have posted here, so I won't bother looking at it. What I would suggest is your post, in a datastep using the code window (not attached files), a small sample of test data (I would avoid using actual data). Then show what it is you would like to see at the end, I suspect a simple transpose procedure and then datastep would get what you want but as I don't the output I can't do it.
Also check this two statements:
define bnrind / display style={just=left cellwidth=2.1cm} "Baseline Reference Range Indicator";
define A2N /group order=data style={just=left cellwidth=2.1cm} "Baseline Reference Range Indicator";
you only need the A2N, as this us used in the COLUMN statement
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.