<?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: Using escapechar with put function? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791005#M25572</link>
    <description>&lt;P&gt;I see an opening curly brace (before SYTLE) but no closing one and it's not part of the text?&lt;BR /&gt;&lt;BR /&gt;Full example to test?&lt;BR /&gt;&lt;BR /&gt;Similar to this question I believe:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Applying-superscript-to-a-variable-instead-of-text/td-p/789371" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Applying-superscript-to-a-variable-instead-of-text/td-p/789371&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 19:51:26 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-01-19T19:51:26Z</dc:date>
    <item>
      <title>Using escapechar with put function?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791000#M25571</link>
      <description>&lt;P&gt;I have the following code:&lt;/P&gt;
&lt;PRE&gt;Data year3_insur;
Set year2_insur;	
&lt;BR /&gt;length newvar $20;
&lt;BR /&gt;newvar=cat(put(Row_Percent, 4.1),' [',put(Lower_CL, 4.1),'-',put(Upper_CL, 4.1),']');

DROP RowPercent RowLowerCL RowUpperCL ;

Label newvar="% [95% CL]";
Run;&lt;/PRE&gt;
&lt;P&gt;It concatenates 3 numeric variables into a single string that is put into a Proc Report; the string looks like: 90.0 [88.8-99.99].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to bold the 90.0 numbers (Row_Percent variable). I've tried using the ODS escapechar feature, but can't get it to work. I'm currently writing it as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar=cat(put(Row_Percent, 4.1)^{style [font_weight=bold],' [',put(Lower_CL, 4.1),'-',put(Upper_CL, 4.1),']');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong and how can I make this work?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 19:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791000#M25571</guid>
      <dc:creator>SAS93</dc:creator>
      <dc:date>2022-01-19T19:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using escapechar with put function?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791005#M25572</link>
      <description>&lt;P&gt;I see an opening curly brace (before SYTLE) but no closing one and it's not part of the text?&lt;BR /&gt;&lt;BR /&gt;Full example to test?&lt;BR /&gt;&lt;BR /&gt;Similar to this question I believe:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Applying-superscript-to-a-variable-instead-of-text/td-p/789371" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Applying-superscript-to-a-variable-instead-of-text/td-p/789371&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 19:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791005#M25572</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-19T19:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using escapechar with put function?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791028#M25573</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I want to bold the 90.0 numbers (Row_Percent variable). I've tried using the ODS escapechar feature, but can't get it to work. &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It appears than you are attempting to add characteristics to the value of a variable.&lt;/P&gt;
&lt;P&gt;You do not get to have properties like "bold" as part of the &lt;STRONG&gt;value&lt;/STRONG&gt; of a SAS variable. You have to add instructions elsewhere, such as with a Format or style option override.&lt;/P&gt;
&lt;P&gt;Trivial if you left the 90.0 as a separate variable. Once you make variables holding multiple values then things get very difficult for such.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 21:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791028#M25573</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-19T21:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using escapechar with put function?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791030#M25574</link>
      <description>And what's the final output format? This can make a difference.</description>
      <pubDate>Wed, 19 Jan 2022 21:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791030#M25574</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-19T21:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using escapechar with put function?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791031#M25575</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do not get to have properties like "bold" as part of the &lt;STRONG&gt;value&lt;/STRONG&gt; of a SAS variable.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think it may be possible as in the linked example with the superscript added in to the variable value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;EDIT: Not within a data set, but as output to an Excel file, PDF, HTML, Word doc should be possible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 21:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791031#M25575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-19T21:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using escapechar with put function?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791126#M25577</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input v lower upper;
newvar=cat(put(v,4.1),'~S={font_weight=bold} [',put(Lower, 4.1),'-',put(Upper, 4.1),']');
cards;
0.12  0.01 0.24
0.22  0.12 0.54
;

ods escapechar='~';
ods rtf file='c:\temp\temp.rtf' style=journal bodytitle;
proc report data=have nowd;
run;
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1642681095591.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67539i4B530E6DCE48AE42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1642681095591.png" alt="Ksharp_0-1642681095591.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 12:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-escapechar-with-put-function/m-p/791126#M25577</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-01-20T12:18:22Z</dc:date>
    </item>
  </channel>
</rss>

