BookmarkSubscribeRSS Feed
brentphillippi
New User | Level 1

Using SAS Studio 9.4. In the Results window the orange cell highlighting shows:

brentphillippi_0-1722458586982.png

but in the Excel file the orange highlighted cells disappear:

brentphillippi_0-1722458866010.png

 

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?

1 REPLY 1
ballardw
Super User

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"

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 76 views
  • 0 likes
  • 2 in conversation