I would like to apply a bold font weight to some text I have in a PROC FORMAT. This what I have:
ods escapechar='^';
The way you are attempting to use your FD format won't work because FOREGROUND will not recognize anything other than a color as a valid value.
You would need two formats, one for color and the other for font weight.
proc format;. value $FD 'TEXT 1' = 'white'. 'TEXT 2' = 'white' ; value $FW 'TEXT 1' = 'normal'. 'TEXT 2' = 'bold' ; run;. . proc tabulate data=DAT s=[font=("arial")];. class UA;. classlev UA / style={foreground=$FD. fontweight=$FW. font=("arial")};. var X / style={font=("arial") fontweight=bold};. table UA, X;. run;.
You don't show how you are using SC but I suspect that you actually want 3 formats, foreground, fontsize for style overrides and the Unicode value to be displayed
Show how you are generating output, proc print, report, tabulate or other procedure. There are minor differences between them depending on where the style elements are to be applied.
And some examples of the data as data step would help.
Information of which ODS style you are using may be helpful as well.
The way you are attempting to use your FD format won't work because FOREGROUND will not recognize anything other than a color as a valid value.
You would need two formats, one for color and the other for font weight.
proc format;. value $FD 'TEXT 1' = 'white'. 'TEXT 2' = 'white' ; value $FW 'TEXT 1' = 'normal'. 'TEXT 2' = 'bold' ; run;. . proc tabulate data=DAT s=[font=("arial")];. class UA;. classlev UA / style={foreground=$FD. fontweight=$FW. font=("arial")};. var X / style={font=("arial") fontweight=bold};. table UA, X;. run;.
You don't show how you are using SC but I suspect that you actually want 3 formats, foreground, fontsize for style overrides and the Unicode value to be displayed
ballardw, you beat me to the "Post" button by a few seconds. But you went through the trouble of finding the solution for me. Thank you ballardw.
The solution is to create a new format specifying 'bold' and apply it in the CLASSLEV statement as another one of the already-existing style elements:
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.