Greetings, I am using the numeric variable _28DayRem to set the background of_28Day.
proc report data=WORK.QUERY_FOR_FCN4 missing nowd;
column
(_28DayRem _28Day);
define _28DayRem / display ;
define _28Day / display '28-Day'
style(header)={background=white foreground=black};
compute _28Day;
if _28DayRem = 0 then call define(_col_,"style",
"style={background=white foreground=black}");
else if _28DayRem < 0 then call define(_col_,"style",
"style={background=Red foreground=white font_weight=bold}");
endcomp;
quit;
The colors are not responding to the IF statement, color change should be set when _28DayRem = -25:
Thanks.
Thanks for the quick reply and advise. Cool script @ballardw, love the screenshot @Cynthia_sas 🙂
Honored to have heavy hitters respond, hence my embarrassment and apologies for my mistake...
I had placed this option on a scrip that I include with just about every program as default.
So now with this change:
Life's good:
With my made up dummy data the text changes colors. You may have to provide a data step with your exact values.
It also isn't possible to tell if the table you posted is the desired output or your actual output. The result you show does have the text appearance change when the value is -25. I'm more concerned about why you 0 values are showing a red background.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.
Hi:
I agree with @ballardw. With my fake data (shown below), I can cause bad highlighting by NOT accounting for the condition where the value is GT 0, but I get the correct highlighting. There must be something else in your code or your data that is not provided to us. My highlighting works, as shown in Report #2.
Cynthia
Thanks for the quick reply and advise. Cool script @ballardw, love the screenshot @Cynthia_sas 🙂
Honored to have heavy hitters respond, hence my embarrassment and apologies for my mistake...
I had placed this option on a scrip that I include with just about every program as default.
So now with this change:
Life's good:
Glad that you found the solution and that my hint may have helped.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.