DATA Step, Macro, Functions and more

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

Reply
Regular Contributor
Posts: 200

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

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

Super User
Posts: 9,600

Re: how to group or order a variable if it is used analysis in define statement

Please post the report code you already have, so we can have an idea where to change it.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Regular Contributor
Posts: 200

Re: how to group or order a variable if it is used analysis in define statement

Posted in reply to KurtBremser

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;

 

 

Super User
Posts: 10,618

Re: how to group or order a variable if it is used analysis in define statement

option ORDER= ?

 

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

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 112 views
  • 0 likes
  • 3 in conversation