<?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: Question Regarding CATS Function: SAS Does Not Seem to Recognizes &amp;quot;&amp;lt;/a&amp;gt;&amp;quot; Segment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922562#M363268</link>
    <description>&lt;P&gt;Thanks! event_id and page are not macro variables. They are just variables that I want to include in the text string for the HTML url. I unfortunately have to piece together the URL because there are particular unique values for those variables. Any additional thoughts?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2024 15:28:25 GMT</pubDate>
    <dc:creator>JackZ295</dc:creator>
    <dc:date>2024-04-02T15:28:25Z</dc:date>
    <item>
      <title>Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922540#M363258</link>
      <description>&lt;P&gt;Hi! I'm trying to concatenate a series of variables and text in a cats function in SAS, but for some reason, SAS will not recognize the last segment of my string "&amp;lt;/a&amp;gt;" that I want to concatenate. My code is as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data four;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set three;&amp;nbsp;&lt;/P&gt;&lt;P&gt;link_1="&amp;lt;a href=";&lt;BR /&gt;link_2="url";&lt;BR /&gt;link_3="&amp;amp;event_id=";&lt;BR /&gt;link_4="&amp;amp;page=";&lt;BR /&gt;link_a="&amp;lt;/a&amp;gt;";&lt;/P&gt;&lt;P&gt;qi106=cats(link_1,'"',link_2, record_id, link_3, event_id, link_4, page,"'", link_a);&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to print out the data set with just the link_a segment, e.g.:&amp;nbsp;&lt;/P&gt;&lt;P&gt;data four;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set three;&lt;/P&gt;&lt;P&gt;link_a="&amp;lt;/a&amp;gt;";&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;link_a just shows up as blank. Is there a reason why? Any input regarding this would be much appreciated! Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 13:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922540#M363258</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2024-04-02T13:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922545#M363259</link>
      <description>&lt;P&gt;Are you printing to an ODS HTML destination?&lt;/P&gt;
&lt;P&gt;If so the tag won't visible in your report.&lt;/P&gt;
&lt;P&gt;You should be able to confirm it's there by using a ODS LISTING.&lt;/P&gt;
&lt;P&gt;What SAS client are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 13:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922545#M363259</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-04-02T13:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922547#M363260</link>
      <description>&lt;P&gt;Hm, yes I'm trying to concatenate a string to create an HTML hyperlink. Is that possible within SAS? I'm using SAS 9.4.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 13:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922547#M363260</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2024-04-02T13:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922548#M363261</link>
      <description>&lt;P&gt;You do realize that CATS code is creating a value with unbalanced quotes don't you?&lt;/P&gt;
&lt;PRE&gt;qi106=cats(link_1,'&lt;FONT size="5" color="#FF00FF"&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/FONT&gt;',link_2, record_id, link_3, event_id, link_4, page,"&lt;FONT size="5" color="#339966"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;", link_a); 

&lt;/PRE&gt;
&lt;P&gt;That means most processors for quoted values would expect Link_a to be within the not closed string starting with the double quote.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might consider using single quotes in the Link_3 and Link_4 code. Currently SAS is expecting macro variables Event_id and Page to be defined. If you don't want to accidentally use such a macro variable if defined then use the&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 13:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922548#M363261</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-02T13:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922550#M363262</link>
      <description>&lt;P&gt;We do not have your dataset THREE so we don't know what values it has for EVENT_ID, RECORD_ID or PAGE.&lt;/P&gt;
&lt;P&gt;You also did not set values for the macro variable EVENT_ID or PAGE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if we make up some data we can then add a PUT statement to your data step so we can see what your function call generated.&lt;/P&gt;
&lt;PRE&gt;80   data three;
81     event_id='event';
82     page='page';
83     record_id='record';
84   run;

NOTE: The data set WORK.THREE has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


85
86   %let event_id=macro_event;
87   %let page=macro_page;
88
89   data four;
90
91   set three;
92
93   link_1="&amp;lt;a href=";
94   link_2="url";
95   link_3="&amp;amp;event_id=";
96   link_4="&amp;amp;page=";
97   link_a="&amp;lt;/a&amp;gt;";
98
99   qi106=cats(link_1,'"',link_2, record_id, link_3, event_id, link_4, page,"'", link_a);
100  put qi106=;
101  run;

qi106=&amp;lt;a href="urlrecordmacro_event=eventmacro_page=page'&amp;lt;/a&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;It does not help that you used a double quote at beginning of the generated URL and a single quote at the end.&lt;/P&gt;
&lt;P&gt;Also the HTML is not valid.&amp;nbsp; You should have something like:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;a href="url_to_goto"&amp;gt;Click here&amp;lt;/a&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the goal is to generate a quoted URL wouldn't it be much clearer to generate the URL and then use QUOTE() function to add the quotes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 13:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922550#M363262</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-02T13:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922562#M363268</link>
      <description>&lt;P&gt;Thanks! event_id and page are not macro variables. They are just variables that I want to include in the text string for the HTML url. I unfortunately have to piece together the URL because there are particular unique values for those variables. Any additional thoughts?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 15:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922562#M363268</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2024-04-02T15:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922563#M363269</link>
      <description>&lt;P&gt;Also, a follow up question is if we would need to have a title for the hyperlink (where you wrote "Click Here"), or if we could omit that section of the HTML.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 15:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922563#M363269</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2024-04-02T15:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922569#M363272</link>
      <description>&lt;P&gt;If you don't have macro variables EVENT_ID then do reference it by having "&amp;amp;EVENT_ID" in your code.&amp;nbsp; Perhaps you meant to use generate a URL the uses EVENT_ID as a parameter value to pass into the program the interprets the link?&amp;nbsp;Note that normally I have seen that URL's user ? for the first parameter and &amp;amp; for the following ones.&amp;nbsp; But check a few working URL's for your situation to be sure what syntax works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the macro processor to ignore the &amp;amp; then enclose that string in single quotes instead of double quotes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &amp;lt;A&amp;gt; tag is not going to add much value to an actual user if there is nothing for them to click on to go to the target link.&amp;nbsp; If you don't have a more descriptive text then just repeat the URL so the user can see it on the page. Or perhaps just the variable parts of the link?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data four;
  set three;
  length url qi106 $300 ;
  url=cats('http://hostname/pagename'
         ,'?record_id=',record_id
         ,'&amp;amp;event_id=',revent_id
         ,'&amp;amp;page=',page
    );
  qi106=cats('&amp;lt;a href=',quote(trim(url)),'&amp;gt;',url,'&amp;lt;/a&amp;gt;');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 15:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922569#M363272</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-02T15:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922582#M363282</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;! I did make the change to enclose the non-macro variables in single quotes. For some reason, the HTML URL hyperlink doesn't generate in the output. Does it generate for you? I know someone else had mentioned the ODS HTML, but I didn't know what they meant.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 17:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922582#M363282</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2024-04-02T17:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding CATS Function: SAS Does Not Seem to Recognizes "&lt;/a&gt;" Segment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922586#M363284</link>
      <description>&lt;P&gt;Forgot to close the bracket; thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 17:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-Regarding-CATS-Function-SAS-Does-Not-Seem-to-Recognizes/m-p/922586#M363284</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2024-04-02T17:38:20Z</dc:date>
    </item>
  </channel>
</rss>

