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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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