Using SAS Studio 9.4. In the Results window the orange cell highlighting shows:
but in the Excel file the orange highlighted cells disappear:
Here is the ods and proc print statement:
ods excel
file="\\sasprod01\prisonersbay\clin_data\&prod.\&prot.\&outpath.\&prot._Discrepancy_Checks_&thedate._&thetime..xlsx"
style=Sapphire options(autofilter="ALL" sheet_name="" embedded_titles="yes" embed_titles_once="yes" );
ods excel options(sheet_name="EXDCC_010");
proc report data=diffall2 list ;
column record &keyvars &comparevars;
define record/ display "Record";
%do i=1 %to &numcomp;
compute %scan(&comparevars,&i,' ');
%let temp=%scan(&comparevars,&i,' ');
if record=2 and %scan(&comparevars,&i,' ') ne lag1( %scan(&comparevars,&i,' ')) then do;
call define ("&temp","style","style={background=orange}");
end;
else if record=3 then call define (_row_,"style","style={background=lightblue}");
else if record=4 then call define (_row_,"style","style={background=lightgreen}");
endcomp;
%end;
run;
Any ideas?
Easiest to test would be a different color instead of orange, like Red, in the Proc Report call define code. Just in case your Excel doesn't like orange in that context.
There is no way anyone can attempt to duplicate your result without data or the definitions of way too many macro variables. Perhaps running the code with options MPRINT turned on would show something when this resolves that would give a hint.
if record=2 and %scan(&comparevars,&i,' ') ne lag1( %scan(&comparevars,&i,' ')) then do; call define ("&temp","style","style={background=orange}"); end;
It might also help to show the code that successfully uses orange in the "Orange=Value Difference"
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: