Hi everyone!
I have the following code and it works fine, except that I like to be able to format the value in the Csal, Cuni and Csalt variables, such as making the font color or back ground color of the values in the Csal, Cuni and Csalt variables different than the texts preceding them.
I appreciate any help you could provide!
compute after / style=Header{just=l fontweight=bold fontsize=14pt};
region = 'All Regions';
Csal = left(put(salesmn,dollar10.));
Cuni = left(put(unit_pricemn,dollar10.));
Csalt = left(put(sales_taxmn,dollar10.));
line "^{style[textdecoration=underline]Averages for These Regions}";
line "Sales: " Csal $varying50.;
line "Unit Price: " Cuni $varying50.;
line "Sales Tax: " Csalt $varying50.;
endcomp;
run;
Ethen,
You call define with foreground= or background=
Check this out:
proc format;
value $stat 'Normal'='green'
'Underweight'='orange'
'Overweight'='red';
run;
proc report data=sashelp.heart;
column bp_status weight_status ageatstart;
define bp_status /group ;
define weight_status /group;
define ageatstart/mean format=8.2;
compute weight_status;
call define(_col_,'style','style={foreground=$stat.}');
endcomp;
run;
Hi:
If you want to change the font color of text in a LINE statement, you have limited choices. Either you change the color of the WHOLE string or you use ODS ESCAPECHAR, as shown below:
If you want to use the normal RBREAK statement and a CALL DEFINE, then you can change foreground color and background color, to produce this:
using this code:
Hope this helps,
Cynthia
Hi Cynthia!
Thank you! I appreciate your time very much!
Your codes worked exactly the way I needed for it to work.
Thanks, again!
Ethen,
HI Suryakiran!
Thank you! I appreciate your time very much!
Your codes worked, but they applied the styles to the values in the column and not the line statement.
Thanks!
Mark,
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.