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:
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.