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:
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.