This works fine:
proc format;
value Bla
low -< -1.0 = "red"
-1 -< 0 = "green"
0 - high = "white";
run;
proc print data=Temp NOOBS;
var X Y Z
/style(data) = [background=Bla.];
run;
I am in a situation where my vars are dynamic so I cannot use the /style option. Is there a way to apply the above format to all numeric values in the table to be printed?
You can always use var, even if its a matter of doing:
proc sql; select name into :vlist separated by " " from sashelp.vcolumn where libname="WORK" and memname="TEMP"; quit; proc print data=temp; var &vlist.; run;
"Can't" is not in programming.
As for the issue, the key is to use the _numeric_ SAS command, which means all numeric variables:
proc print data=temp; var _numeric_ / style(data)=[background=bla.]; run;
Something like:
proc print data=temp noobs; var x y z; format _numeric_ bla.; run;
You can always use var, even if its a matter of doing:
proc sql; select name into :vlist separated by " " from sashelp.vcolumn where libname="WORK" and memname="TEMP"; quit; proc print data=temp; var &vlist.; run;
"Can't" is not in programming.
As for the issue, the key is to use the _numeric_ SAS command, which means all numeric variables:
proc print data=temp; var _numeric_ / style(data)=[background=bla.]; 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 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.