@ballardw,
Thank you for your feedback. Below if my code from Proc report and Data (simulated) that i'm working on. I was using define VISIT/ group statement. But order=data option is what I'm looking for. It really does the job the way I expected. Thank you!
@Kurt_Bremser, I like the approach you suggested, but the above way seems more efficient in my situation. I appreciate your time and support! @Shaik_Adil, I'm providing the data and codes below as an answer to your question. Thank you for checking in with me! Again, thank you all for spending time to read and answer my post!
data have;
length Visit $25;
input VISIT $ _n _mean _std ;
datalines;
Week12 210 0.55 0.84
Month8 150 0.05 0.73
Month12 120 0.07 0.51
Month16 135 0.33 0.65
Month20 101 0.06 0.43
Month24 256 0.35 0.71
Month28 175 0.11 0.43
;
run;
ods tagsets.excelxp file = "C:\Users\Desktop\test\Score_tables.xml" style=listing
options(sheet_name= "Table 3 - Categorical" embedded_titles = "on" embedded_footnotes = "on" Merge_Titles_Footnotes = "on" missing_align= 'center' Row_Heights='24,16,0,32,32,0,0' Skip_Space= '0,0,0,1,1');
proc report data= have spanrows style(report)={background=white borderrightcolor=white borderleftcolor=white bordertopcolor=black borderbottomcolor=black bordertopwidth=1pt borderbottomwidth=1pt}
style(header)={height=24pt font_face='TREBUCHET MS' fontsize=11pt background=white borderrightcolor=white borderleftcolor=white bordertopcolor=black borderbottomcolor=black bordertopwidth=1 borderbottomwidth=1} out=report_scorechange;
column visit _n _mean _std;
define visit/ "VISIT" width=25 style(header)= {just=l} style(column)= {just=l font_face='TREBUCHET MS' fontsize=11pt borderleftcolor=white borderleftwidth=.5pt borderrightcolor=white borderrightwidth=.5pt} group;
define _n/ "n" center width=8 style(column)= {just=c font_face='TREBUCHET MS' fontsize=11pt borderleftcolor=white borderleftwidth=.5pt borderrightcolor=white borderrightwidth=.5pt} display;
define _mean/ "Mean" center width=8 style(column)= {just=c font_face='TREBUCHET MS' fontsize=11pt borderleftcolor=white borderleftwidth=.5pt borderrightcolor=white borderrightwidth=.5pt} display;
define _std/ "SD" center width=8 style(column)= {just=c font_face='TREBUCHET MS' fontsize=11pt borderleftcolor=white borderleftwidth=.5pt borderrightcolor=white borderrightwidth=.5pt} display;
compute before visit/ style = {indent=2 just=l font_face='TREBUCHET MS' fontsize=11pt borderleftcolor=white borderleftwidth=.5pt borderrightcolor=white borderrightwidth=.5pt};
Line @3 Text $50.;
length text $50;
if strip(visit) eq "Week12" then text= "Reference Timepoint";
else text= "Change from Week 12";
endcomp;
run;
ods tagsets.excelxp close;
... View more