<?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: How to use both hyperlinks AND macro variables in a single ODS RTF text= statement in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432558#M20296</link>
    <description>&lt;P&gt;Thanks to both of you! For some reason all the examples I saw put double quotes around the url itself and I assumed stupidly that it must be that way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2018 23:04:05 GMT</pubDate>
    <dc:creator>sm4</dc:creator>
    <dc:date>2018-01-30T23:04:05Z</dc:date>
    <item>
      <title>How to use both hyperlinks AND macro variables in a single ODS RTF text= statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432485#M20292</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS output text= statements must be in single quotes to get hyperlinks to work, but they must be in double quotes to get macro variables to resolve. So how do we do both in a single text= statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally for getting macro vars to resolve in single quotes, you could use something like %unquote(%str()), but we can't use functions in text= statements...I believe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the formatting I'm using for the text= statement:&lt;/P&gt;&lt;PRE&gt;ods rtf text= '^S={URL="https://website"}This is the macro var I want to resolve: &amp;amp;macrovar_here.';&lt;/PRE&gt;&lt;P&gt;Would appreciate any tips or workarounds if anyone has any ideas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 20:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432485#M20292</guid>
      <dc:creator>sm4</dc:creator>
      <dc:date>2018-01-30T20:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use both hyperlinks AND macro variables in a single ODS RTF text= statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432490#M20293</link>
      <description>&lt;P&gt;That's not quite correct.&lt;BR /&gt;Use outer quotes that are double quotes and single quotes around the URL. This seems to work for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;ods rtf file='C:\_localdata\temp\test.rtf' style=meadow;
%let test=mytest;
ods escapechar='^';

ods rtf text="^S={URL='https://website'}This is the macro var I want to resolve: &amp;amp;test.";
proc print data=sashelp.class;
run;

ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 20:44:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432490#M20293</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T20:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use both hyperlinks AND macro variables in a single ODS RTF text= statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432494#M20295</link>
      <description>&lt;P&gt;Whether macro variable references are resolved is determined by the outer quotes.&lt;/P&gt;
&lt;P&gt;Not clear that you need to use double quotes instead of single quotes where your string has them,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf text= "^S={URL='https://website'}This is the macro var I want to resolve: &amp;amp;mvar.";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but if you do then just double them up.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf text= "^S={URL""https://website""}This is the macro var I want to resolve: &amp;amp;mvar.";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or ask SAS to do it for you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf text=%sysfunc(quote(^S={URL="https://website"}This is the macro var I want to resolve: &amp;amp;mvar.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432494#M20295</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-30T21:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use both hyperlinks AND macro variables in a single ODS RTF text= statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432558#M20296</link>
      <description>&lt;P&gt;Thanks to both of you! For some reason all the examples I saw put double quotes around the url itself and I assumed stupidly that it must be that way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 23:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432558#M20296</guid>
      <dc:creator>sm4</dc:creator>
      <dc:date>2018-01-30T23:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use both hyperlinks AND macro variables in a single ODS RTF text= statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432559#M20297</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;Stupidly believed I had to use double quotes around the url and did not test single quotes there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 23:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-both-hyperlinks-AND-macro-variables-in-a-single-ODS/m-p/432559#M20297</guid>
      <dc:creator>sm4</dc:creator>
      <dc:date>2018-01-30T23:06:33Z</dc:date>
    </item>
  </channel>
</rss>

