<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Printing single words/strings bold with proc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895539#M353834</link>
    <description>&lt;P&gt;Since it looks like you are using ODS output you should be able to use ODS ESCAPECHAR to embed the style setting into the value of your character variable.&amp;nbsp; Change the FONTWEIGHT to make it bold or heavy.&amp;nbsp; Make sure to make the variable long enough to contain the extra characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example&amp;nbsp;Let's also change the color to make it more obvious in the output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
  set sashelp.class;
  where name=:'J';
  length boldname $100 ;
  boldname = tranwrd(name,'an','(*ESC*){style [fontweight=extra_bold color=red]an}');
  format boldname;
run;
proc print data=class;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1695490664487.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88239i0A24C7ED319D5B05/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1695490664487.png" alt="Tom_0-1695490664487.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Sep 2023 17:37:52 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-23T17:37:52Z</dc:date>
    <item>
      <title>Printing single words/strings bold with proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895409#M353771</link>
      <description>&lt;P&gt;Hey Guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;quick question. I want to print a table via proc report and highlight certain parts via bold/italic/underlining. Unfortunately, I only manage to print a whole column bold like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88222iCF5A8F32FE10E5E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen.JPG" alt="Screen.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;But I would like the table to look something like this (e. g. if I only want to print the "4dr" part as bold) --&amp;gt; So everything besides "4dr" should be plain text and "4dr" should be printed as bold text.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen2.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88223iA598149BDFA104FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen2.JPG" alt="Screen2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My code so far looks like this and I did not manage to customize it accordingly&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
set sashelp.cars (obs=20);
run;
ods pdf file="yourpath\test.pdf";
title;

ods pdf startpage=no;
ods layout start width=19cm height=28cm;

proc report data=cars;
	column Make Model Type;
	define Make / "MAKE" ;
	define Model / "MODEL" ;
	define Type / "TYPE" ;
	compute Model;
	if Make = 'Acura' then call define(_col_,'style','style={fontweight=bold}');
	endcomp;
run;


ods layout end;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have got any hints for me how to achieve the desired result I'd be grateful. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 09:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895409#M353771</guid>
      <dc:creator>_Manhattan</dc:creator>
      <dc:date>2023-09-22T09:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Printing single words/strings bold with proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895531#M353830</link>
      <description>&lt;P&gt;Maybe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp; knew it .&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 10:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895531#M353830</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-09-23T10:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Printing single words/strings bold with proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895539#M353834</link>
      <description>&lt;P&gt;Since it looks like you are using ODS output you should be able to use ODS ESCAPECHAR to embed the style setting into the value of your character variable.&amp;nbsp; Change the FONTWEIGHT to make it bold or heavy.&amp;nbsp; Make sure to make the variable long enough to contain the extra characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example&amp;nbsp;Let's also change the color to make it more obvious in the output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
  set sashelp.class;
  where name=:'J';
  length boldname $100 ;
  boldname = tranwrd(name,'an','(*ESC*){style [fontweight=extra_bold color=red]an}');
  format boldname;
run;
proc print data=class;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1695490664487.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88239i0A24C7ED319D5B05/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1695490664487.png" alt="Tom_0-1695490664487.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 17:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895539#M353834</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-23T17:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Printing single words/strings bold with proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895626#M353864</link>
      <description>&lt;P&gt;Thank you so much Tom, you've saved my day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 08:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-single-words-strings-bold-with-proc-report/m-p/895626#M353864</guid>
      <dc:creator>_Manhattan</dc:creator>
      <dc:date>2023-09-25T08:00:45Z</dc:date>
    </item>
  </channel>
</rss>

