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

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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

 

 

View solution in original post

3 REPLIES 3
BrunoMueller
SAS Super FREQ

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

 

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

BrunoMueller
SAS Super FREQ

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 735 views
  • 0 likes
  • 3 in conversation