<?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 Highlighting part of string value in proc report column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Highlighting-part-of-string-value-in-proc-report-column/m-p/902522#M356684</link>
    <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a proc report table that I'm producing and I need to highlight the first word in the values.&amp;nbsp; Is there a way to code for that in the proc report statement.&lt;/P&gt;
&lt;P&gt;Also, if anyone would know how to code something in the middle of the string (ex:&amp;nbsp; 4dr, 2dr) that could be helpful too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used a SAS dataset to give a basic example of the code and output.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="8b10ebf7-6ee9-45fd-91c9-48459897e0c4.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89626iB98F610E9F73B0C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="8b10ebf7-6ee9-45fd-91c9-48459897e0c4.png" alt="8b10ebf7-6ee9-45fd-91c9-48459897e0c4.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;DIV&gt;data audi;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; set sashelp.cars;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; where make="Audi";&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;ods listing close;&lt;/DIV&gt;
&lt;DIV&gt;ods excel file="C:\test.xlsx";&lt;/DIV&gt;
&lt;DIV&gt;ods excel options(sheet_name="test" sheet_interval="none");&lt;/DIV&gt;
&lt;DIV&gt;proc odstext;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; p "This gives Audi cars" / style=[font_weight=bold font_size=16pt cellwidth=15in];&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; p " ";&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;proc report data=audi&lt;/DIV&gt;
&lt;DIV&gt;style(report)={font_size=12pt}&lt;/DIV&gt;
&lt;DIV&gt;style(header)={font_size=12pt background = aliceblue}&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;style(column)={font_size=12pt};&lt;/DIV&gt;
&lt;DIV&gt;column (make model type);&lt;/DIV&gt;
&lt;DIV&gt;define make / 'Make of car' display;&lt;/DIV&gt;
&lt;DIV&gt;define model/'Model of car' display;&lt;/DIV&gt;
&lt;DIV&gt;define type / 'Type of car' display;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;ods excel close;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2023 15:09:07 GMT</pubDate>
    <dc:creator>HN2001</dc:creator>
    <dc:date>2023-11-10T15:09:07Z</dc:date>
    <item>
      <title>Highlighting part of string value in proc report column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Highlighting-part-of-string-value-in-proc-report-column/m-p/902522#M356684</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a proc report table that I'm producing and I need to highlight the first word in the values.&amp;nbsp; Is there a way to code for that in the proc report statement.&lt;/P&gt;
&lt;P&gt;Also, if anyone would know how to code something in the middle of the string (ex:&amp;nbsp; 4dr, 2dr) that could be helpful too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used a SAS dataset to give a basic example of the code and output.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="8b10ebf7-6ee9-45fd-91c9-48459897e0c4.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89626iB98F610E9F73B0C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="8b10ebf7-6ee9-45fd-91c9-48459897e0c4.png" alt="8b10ebf7-6ee9-45fd-91c9-48459897e0c4.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;DIV&gt;data audi;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; set sashelp.cars;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; where make="Audi";&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;ods listing close;&lt;/DIV&gt;
&lt;DIV&gt;ods excel file="C:\test.xlsx";&lt;/DIV&gt;
&lt;DIV&gt;ods excel options(sheet_name="test" sheet_interval="none");&lt;/DIV&gt;
&lt;DIV&gt;proc odstext;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; p "This gives Audi cars" / style=[font_weight=bold font_size=16pt cellwidth=15in];&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; p " ";&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;proc report data=audi&lt;/DIV&gt;
&lt;DIV&gt;style(report)={font_size=12pt}&lt;/DIV&gt;
&lt;DIV&gt;style(header)={font_size=12pt background = aliceblue}&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;style(column)={font_size=12pt};&lt;/DIV&gt;
&lt;DIV&gt;column (make model type);&lt;/DIV&gt;
&lt;DIV&gt;define make / 'Make of car' display;&lt;/DIV&gt;
&lt;DIV&gt;define model/'Model of car' display;&lt;/DIV&gt;
&lt;DIV&gt;define type / 'Type of car' display;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;ods excel close;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 15:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Highlighting-part-of-string-value-in-proc-report-column/m-p/902522#M356684</guid>
      <dc:creator>HN2001</dc:creator>
      <dc:date>2023-11-10T15:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting part of string value in proc report column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Highlighting-part-of-string-value-in-proc-report-column/m-p/902566#M356694</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ODS ESCAPECHAR to the rescue. For most ODS destinations, you can use ODS ESCAPECHAR to insert style overrides for pieces of a string. This is easier to do in a DATA step before your reporting step so that you can use the SCAN, SUBSTR and CAT functions to rebuild the string with the ESCAPECHAR overrides.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's an example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1699637762920.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89655iFCA56E3637C92CA0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1699637762920.png" alt="Cynthia_sas_0-1699637762920.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This works in ODS HTML and ODS EXCEL, as shown above. I added the colors with the bold, so the changes would stand out in the screen shot. Of course, this does assume that the strings 4dr and 2dr are all you're looking for and that the string is exactly 3 characters long and that by the first word, you meant the first "chunk" of the Model variable up to the first space in the value.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 17:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Highlighting-part-of-string-value-in-proc-report-column/m-p/902566#M356694</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-11-10T17:38:07Z</dc:date>
    </item>
  </channel>
</rss>

