The SAS Output Delivery System and reporting techniques

Conditional formating in SAS

Reply
Occasional Contributor
Posts: 13

Conditional formating in SAS

Can anyone tell me how to  do conditional formatting in SAS.

 

regards,

arthi

Super User
Super User
Posts: 7,942

Re: Conditional formating in SAS

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.

Super User
Posts: 19,771

Re: Conditional formating in SAS

What type of report are you generating, PDF, RTF, HTML, Excel? 

 

You can use Proc report to implement conditional highlighting. 

Super User
Posts: 10,020

Re: Conditional formating in SAS

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;
Ask a Question
Discussion stats
  • 3 replies
  • 278 views
  • 0 likes
  • 4 in conversation