BookmarkSubscribeRSS Feed
vraj1
Quartz | Level 8

how to group or order a  variable if it is used analysis in define statement in proc report.

3 REPLIES 3
vraj1
Quartz | Level 8

options missing = "" ls=200;
proc report data = rep nowd split = "¤" headline missing contents = "" out=rep1;
column param actarmn actarm timevar (' ' Ntot) anrind, (count pctc ) a1ind, (count2 pctc2 ) dummy ;
define param / group style(header)={just=left cellwidth=4.5cm} style(column)=IdColIndent2{asis=on} "Parameter" ;
define actarmn / group order=internal noprint;
define actarm / group style(header)={just=left cellwidth=2cm} style(column)=IdColIndent2{asis=on} "Treatment Group";
define timevar /group order=data style={just=right cellwidth=2cm} "Week";
define anrind /across order=data style={just=left} "Normal Range";
define Ntot / analysis "N" style={just=right cellwidth=0.81346153846152cm} ;
define dummy /noprint;
define a1ind /across order=data style={just=left} "PCS";
define count /analysis order=internal group sum style={just=right cellwidth=0.81346153846152cm} "n";
define count2 /analysis order=internal group sum style={just=right cellwidth=0.81346153846152cm} "n";
define pctc /display order=internal group style={just=right cellwidth=1.08461538461536cm} "(%)";
define pctc2 /display order=internal group style={just=right cellwidth=1.08461538461536cm} "(%)";
compute before;
line @1 ' ';
endcomp;

compute after actarmn;
line ' ';
endcomp;

run;

 

 

Ksharp
Super User

option ORDER= ?

 

proc report data=sashelp.class nowd;
column sex age;
define sex/group;
define age/analysis sum order=data;
run;

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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