I am trying to output SAS DS with multiple columns into excel and want to show two columns' name/label with two different colors. Please see the expected example output below:
So I need both black and red colors in one cell label. I have done this for the cell rows using ^{style option but same doesn't work for labels.
Sample code:
data test;
input lab s1 $ s2 $;
datalines;
1 A1 A2
2 B1 B2
3 C1 C2
;
run;
proc report data=test nowindows missing
style(column)=[foreground=black background=WHITE font_face=arial font_size=10pt just=center ]
style(header)=[foreground=black background=white font_face=arial font_size=10pt just=center fontweight=bold];
column lab s1 s2;
define lab/"Lab Number" center;
define s1/"sample 1 (Use this on Primary page)" center;
define s2/"sample 2 (Use this on Secondary page)" center;
run;
Please suggest how this can be done?
Thank You.
Hi:
You do not show how you are getting the output into Excel. What is your ODS destination? Can you share the rest of your code?
Cynthia
Just as an example using ODS ESCAPECHAR functions for the style override with ODS EXCEL worked for me, as shown below (my changes to your code are shown in yellow):
Hi:
You do not show how you are getting the output into Excel. What is your ODS destination? Can you share the rest of your code?
Cynthia
Just as an example using ODS ESCAPECHAR functions for the style override with ODS EXCEL worked for me, as shown below (my changes to your code are shown in yellow):
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.