Here is the code usually I used. ODS noresults; ODS listing close; /*Turn off the standard line printer destination*/ ods tagsets.ExcelXP path="&dir." file="Example.xml" style=seaside /*Styles to control appearance of output*/; ods tagsets.ExcelXP options ( sheet_name= "Summary" autofit_height= 'yes' frozen_rowheaders="8" frozen_headers= '2' absolute_column_width= '30,15,15,6,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10'); options missing=" "; proc Report data=summary1 NOWD style(header)=[foreground=white background=teal]; Column ReportingGroup exam form OP_Item en Raw_Score_Mean Raw_Score_Std Mean_Pval Mean_Ptbis qn; define exam / center display "Exam" ; define form / center display "Form" ; define op_item / center display "OP Items" ; define en /center display "N"; define Raw_Score_Mean /center display "Raw Score Mean" style(column)={tagattr="format:###.00"}; define Raw_Score_Std /center display "Raw Score Stdev" style(column)={tagattr="format:###.00"}; define Mean_Pval /center display "Mean P value" style(column)={tagattr="format:##0.00"}; define Mean_Ptbis /center display "Mean Point Biserial" style(column)={tagattr="format:##0.00"}; define qn /center display "Flags"; compute exam; count+1; if (mod(count,2)) then do; call define(_row_,"style","style=[background=CXECEDEC]"); end; endcomp; compute form; urlstring= "#'"||strip(Flags)||"'!A1"; call define(_col_,'URL',urlstring); call define(_col_,'style','style={textdecoration=underline color=blue}'); endcomp;*/ run; ods tagsets.ExcelXP options ( sheet_name= "Questions" autofit_height= 'yes' frozen_headers= '2' frozen_rowheaders="8" absolute_column_width= '20,10,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8'); options missing=" "; proc Report data=questions NOWD style(header)=[foreground=white background=teal]; Column ("General Info" ReportingGroup exam form Item status key n pval ptbis qn disturb)("Pval" propa propb propc propd propblank); define exam / center display "Exam" ; define form / center display "Form" ; define item / center display "Items" ; define status / center display "Status"; define key / center display "Key"; define n /center display "N"; define qn /center display "Question Item #"; define disturb / center display "Distractor" style(column)=[font_weight=bold]; compute exam; count+1; if (mod(count,2)) then call define(_row_,"style","style=[background=CXECEDEC]"); endcomp; compute propa; if propa=pval then call define(_col_,"style","style=[font_weight=bold]"); else if n>&numcount. and propa > pval+0.1 then call define(_col_,"style","style=[foreground=red]"); endcomp; compute propb; if propb=pval then call define(_col_,"style","style=[font_weight=bold]"); else if n>&numcount. and propb> pval+0.1 then call define(_col_,"style","style=[foreground=red]"); endcomp; compute propc; if propc=pval then call define(_col_,"style","style=[font_weight=bold]"); else if n>&numcount. and propc > pval+0.1 then call define(_col_,"style","style=[foreground=red]"); endcomp; compute propd; if propd=pval then call define(_col_,"style","style=[font_weight=bold]"); else if n>&numcount. and propd > pval+0.1 then call define(_col_,"style","style=[foreground=red]"); endcomp; run; ods _all_ close; /* Close and release the xml file so it can be opened with Excel*/ ODS listing;
... View more