Can anyone tell me how to do conditional formatting in SAS.
regards,
arthi
Assuming you mean traffic lighting in a report:
https://communities.sas.com/t5/SAS-Procedures/Conditional-formatting-Colors-Colours/td-p/132489
If not, please specify your question, giving details such as test data (form of datastep) and example output.
What type of report are you generating, PDF, RTF, HTML, Excel?
You can use Proc report to implement conditional highlighting.
Here is an example:
proc fcmp outlib=work.functions.smd;
function ftoc(f) $;
length r $ 10;
if f=210 then r='C';
else if f=211 then r=put(f,yymmdd10.);
else r='N';
return (r);
endsub;
run;
options cmplib=(work.functions);
proc format;
value ftoc(default=10) other=[ftoc()];
run;
data have;
input c ;
cards;
210
211
212
;
run;
data have;
set have;
format c ftoc10.;
run;
proc print;run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.