<?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 ods tagsets excelxp hyperlink variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613376#M76874</link>
    <description>&lt;P&gt;I am using ods tagsets excelxp to output excel sheets. I would like to avoid using proc report because I already have the rest of the code written up without it. I have two issues:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I need to create a variable where the values hyperlink to specific webpages but the display is still that of the original variable. So for example, if the variable was gender, then I want the values to show as M/F but if clicked, it would hyperlink to a specific webpage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. the url is a combination of other variable values. so say that I have variables called webpage and pageno so then the url would be &lt;A href="http://www.webpage.com/pageno" target="_blank" rel="noopener"&gt;www.webpage.com/pageno&lt;/A&gt; . I have about 4-5 such variables that are put into the url but I can't get them to resolve right and get the correct url at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 21 Dec 2019 03:17:50 GMT</pubDate>
    <dc:creator>npatel_01</dc:creator>
    <dc:date>2019-12-21T03:17:50Z</dc:date>
    <item>
      <title>ods tagsets excelxp hyperlink variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613376#M76874</link>
      <description>&lt;P&gt;I am using ods tagsets excelxp to output excel sheets. I would like to avoid using proc report because I already have the rest of the code written up without it. I have two issues:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I need to create a variable where the values hyperlink to specific webpages but the display is still that of the original variable. So for example, if the variable was gender, then I want the values to show as M/F but if clicked, it would hyperlink to a specific webpage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. the url is a combination of other variable values. so say that I have variables called webpage and pageno so then the url would be &lt;A href="http://www.webpage.com/pageno" target="_blank" rel="noopener"&gt;www.webpage.com/pageno&lt;/A&gt; . I have about 4-5 such variables that are put into the url but I can't get them to resolve right and get the correct url at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 03:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613376#M76874</guid>
      <dc:creator>npatel_01</dc:creator>
      <dc:date>2019-12-21T03:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: ods tagsets excelxp hyperlink variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613592#M76876</link>
      <description>&lt;P&gt;Can you show what you have attempted?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say you don't want Proc Report. So how do you want to display the values? Proc Print? Tabulate? Something else?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 17:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613592#M76876</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-23T17:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: ods tagsets excelxp hyperlink variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613628#M76877</link>
      <description>Hi:&lt;BR /&gt;  My guess is that you'll have to build your URL variable outside of your procedure. I assume that if you are creating a URL, that you are using either PRINT or TABULATE if you're not doing REPORT. My guess is that a STYLE override with PROC PRINT or TABULATE would work, but you'd also need a user-defined format to make it work.&lt;BR /&gt;Cynthia</description>
      <pubDate>Mon, 23 Dec 2019 21:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/613628#M76877</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-12-23T21:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: ods tagsets excelxp hyperlink variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/639040#M78209</link>
      <description>&lt;P&gt;Say the link is a combination of the site name and page no that are based off of existing variables form and id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro that makes and outputs the link variable and I use the HYPERLINK function to embed the link into the display_link variable but have it print as the form name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize that the code is a mess, I've tried so many things that they've jumbled into one.&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;%macro link(lib, dat);
    proc sql no print;
    select near into :numvars
      from dictionary.tables
     where libmame="&amp;amp;LIB" and memname = "&amp;amp;DAT";
  
   proc datasets library=&amp;amp;LIB;
     modify &amp;amp;DAT;
    %do i=1 %to &amp;amp;numvars.;
 
   call symputx('form', put(form, $35.), 'G');
   call symputx('id', put(pid, $5.), 'G');

   Display_Link="=HYPERLINK(""https://&amp;amp;form.com/&amp;amp;id."", ""&amp;amp;form."")";
output;
%end;

run;
%mend;

%link(work, data);

ods tagsets.excelxp file=data.xls style=custonmjournal options(sheet_name='all IDs' row_repeat=1 ABSOLUTE_COLUMN_WIDTH = '10, 5' orientation='landscape frozen_headers='YES');

proc print data=data noobs label split'/'
  style(column) = {fontsize=8pt}
  style(header) = {fontsize=8py just=l};
  var form id;

  compute id;
  urlstring= Display_Link;
  call define(_col_, 'URL', urlstring);
endcomp;
run;




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 18:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/639040#M78209</guid>
      <dc:creator>npatel_01</dc:creator>
      <dc:date>2020-04-10T18:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: ods tagsets excelxp hyperlink variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/639169#M78219</link>
      <description>Hi: &lt;BR /&gt;  It is nearly impossible to comment constructively without having data to use. The only comment I can make is that &lt;BR /&gt;1) you don't show complete code -- where is your ending ODS TAGSETS.EXCELXP CLOSE?  &lt;BR /&gt;2) Your FILE= option should be a quoted string; &lt;BR /&gt;3) Nobody can even test your code with fake data because you're using a custom style that you do not provide&lt;BR /&gt;4) You can't use a COMPUTE block with PROC PRINT -- only with PROC REPORT.&lt;BR /&gt;&lt;BR /&gt;Also, it's not a good idea to insert a new posting into a post that was created in a different year. It's better to start a new post for a new problem and then to refer to the original 2019 post if it's relevant.&lt;BR /&gt;&lt;BR /&gt;Perhaps if you start a new post and include ALL your code and ALL your data, others will be able to help you.&lt;BR /&gt;Cynthia</description>
      <pubDate>Sat, 11 Apr 2020 17:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ods-tagsets-excelxp-hyperlink-variable/m-p/639169#M78219</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-04-11T17:22:26Z</dc:date>
    </item>
  </channel>
</rss>

