Hi, Here is the full code for this section of the program. Please look at the compute block for dup_label which I have bolded below. This code does turn the cells in the dup_label column orange when dup_label = 'Y'. However, it turn all cells for NAME and LABEL orange. I only want them to be orange for the instances where dup_label = 'Y'. ods excel options(sheet_name=%cmpres("&odsdata") sheet_interval='TABLE' gridlines='ON' flow='DATA'); proc report data=&odsdata nowd style(report)=[bordercolor=black] style(lines)=header{background=white asis=on font_size=10pt font_face="Arial" font_weight=bold color=#000000 just=left bordercolor=black} style(header)=header{background=$color. font_size=10pt font_face="Arial" font_weight=bold color=#000000 frame=box bordercolor=black} style(column)=header{background=white font_size=10pt font_face="Arial" font_weight=medium color=#000000 bordercolor=black}; columns ('_ODS_' NAME LABEL t_vtype t_LENGTH) ('_Source_' MEMNAME name_std label_new vtype LENGTH) ('_Instructions_' Mapping_Notes Variable_Use_Flag sdtm_supp dup_name dup_label Label_Length Comments) ; define NAME / "Variable Name" flow style(column)={cellwidth=1in} style(header)={cellwidth=1in background=#8B9985}; define LABEL / "Variable Label" flow style(column)={cellwidth=2.5in} style(header)={cellwidth=2.5in background=#8B9985}; define t_vtype / "Type" flow style(column)={cellwidth=0.6in} style(header)={cellwidth=0.8in background=#8B9985}; define t_LENGTH / "Length" flow style(column)={cellwidth=0.6in} style(header)={cellwidth=0.6in background=#8B9985}; define MEMNAME / "Dataset" flow style(column)={cellwidth=1in} style(header)={cellwidth=1in background=#ffdab9}; define name_std / "Variable Name" flow style(column)={cellwidth=1in} style(header)={cellwidth=1in background=#ffdab9}; define label_new / "Variable Label" flow style(column)={cellwidth=2.5in} style(header)={cellwidth=2.5in background=#ffdab9}; define vtype / "Type" flow style(column)={cellwidth=0.6in} style(header)={cellwidth=0.8in background=#ffdab9}; define LENGTH / "Length" flow style(column)={cellwidth=0.6in} style(header)={cellwidth=0.6in background=#ffdab9}; define Mapping_Notes / "Mapping Notes" flow style(column)={cellwidth=1in} style(header)={cellwidth=1in background=#00FFFF}; define Variable_Use_Flag / "Variable Use Flag" flow style(column)={cellwidth=1.25in} style(header)={cellwidth=1.25in background=#00FFFF}; define sdtm_supp / "SDTM or Potential Suppqual" flow style(column)={cellwidth=2in} style(header)={cellwidth=2in background=#00FFFF}; define dup_name / "Duplicate Variable" flow style(column)={cellwidth=1.25in} style(header)={cellwidth=1.25in background=#00FFFF}; define dup_label / "Duplicate_Label" flow style(column)={cellwidth=1.25in} style(header)={cellwidth=1.25in background=#00FFFF}; define Label_Length / "Label Length" flow style(column)={cellwidth=1.25in} style(header)={cellwidth=1.25in background=#00FFFF}; define Comments / "Comments" flow style(column)={cellwidth=1.25in} style(header)={cellwidth=1.25in background=#00FFFF}; compute NAME; call define(_COL_,"style","STYLE={background=#ffa500}"); endcomp; compute LABEL; call define(_COL_,"style","STYLE={background=#ffa500}"); endcomp; compute Mapping_Notes; call define(_COL_,"style","STYLE={background=#FFFF00}"); endcomp; compute Variable_Use_Flag; call define(_COL_,"style","STYLE={background=#FFFF00}"); endcomp; compute dup_name; if dup_name = 'Y' then do; call define(_COL_,"style","STYLE={background=#ffa500}"); end; endcomp; compute dup_label; if dup_label = 'Y' then do; call define(_COL_,"style","STYLE={background=#ffa500}"); call define('NAME',"style","STYLE={background=#ffa500}"); call define('LABEL',"style","STYLE={background=#ffa500}"); end; endcomp; compute Label_Length; Label_Length=length(LABEL); if Label_Length > 40 then do; call define(_COL_,"style","STYLE={background=#ffa500}"); end; endcomp; compute Comments; call define(_COL_,"style","STYLE={background=#FFFF00}"); endcomp; run;
... View more