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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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