<?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 Proc Report: Hyperlink cells in one sheet to cells in another sheet in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856220#M26168</link>
    <description>&lt;P&gt;I'm trying to generate an Excel workbook with hyperlinks from a cell in one sheet to a cell in another sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In below self-contained sample: What am I missing?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why does this work with a hard-coded value but not when using variable&amp;nbsp;C1ToC2_ref which got the correct value but appears to be missing at the time when I want to use it in the compute block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let excel_file=c:\test\test_linking.xlsx;

data class_1 class_2(drop=C1ToC2_ref);
  set sashelp.class;
  C1ToC2_ref=cats('#class_2!A',_n_);
run;

ods _all_ close;

ods escapechar='^';
ods excel file="&amp;amp;excel_file" 
  options(
  frozen_headers="1"
  frozen_rowheaders="1"
  sheet_interval='none'
  );

ods excel options(sheet_name="class_1" sheet_interval='now');

proc report data=class_1;
  compute name;
/*    urlstring = "#class_2!A3";*/
    urlstring = C1ToC2_ref;
    if not missing(urlstring) then
      do;
        call define(_col_, 'url',urlstring);
        call define(_col_, 'style', 'style={textdecoration=underline color=blue}');
      end;
  endcomp;
run;

ods excel options(sheet_name="class_2" sheet_interval='now');
proc report data=class_2;
run;

ods excel close;
ods listing;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What I want is an Excel workbook that when I click in sheet &lt;EM&gt;class_1&lt;/EM&gt; on Alice it takes me to &lt;EM&gt;sheet class_2&lt;/EM&gt;,&amp;nbsp;&lt;EM&gt;cell A3&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1675079280473.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79914i6A9D0E7EA322BF52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1675079280473.png" alt="Patrick_0-1675079280473.png" /&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_1-1675079317943.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79915i25E7F8DBC1844EBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_1-1675079317943.png" alt="Patrick_1-1675079317943.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 11:51:48 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-01-30T11:51:48Z</dc:date>
    <item>
      <title>Proc Report: Hyperlink cells in one sheet to cells in another sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856220#M26168</link>
      <description>&lt;P&gt;I'm trying to generate an Excel workbook with hyperlinks from a cell in one sheet to a cell in another sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In below self-contained sample: What am I missing?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why does this work with a hard-coded value but not when using variable&amp;nbsp;C1ToC2_ref which got the correct value but appears to be missing at the time when I want to use it in the compute block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let excel_file=c:\test\test_linking.xlsx;

data class_1 class_2(drop=C1ToC2_ref);
  set sashelp.class;
  C1ToC2_ref=cats('#class_2!A',_n_);
run;

ods _all_ close;

ods escapechar='^';
ods excel file="&amp;amp;excel_file" 
  options(
  frozen_headers="1"
  frozen_rowheaders="1"
  sheet_interval='none'
  );

ods excel options(sheet_name="class_1" sheet_interval='now');

proc report data=class_1;
  compute name;
/*    urlstring = "#class_2!A3";*/
    urlstring = C1ToC2_ref;
    if not missing(urlstring) then
      do;
        call define(_col_, 'url',urlstring);
        call define(_col_, 'style', 'style={textdecoration=underline color=blue}');
      end;
  endcomp;
run;

ods excel options(sheet_name="class_2" sheet_interval='now');
proc report data=class_2;
run;

ods excel close;
ods listing;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What I want is an Excel workbook that when I click in sheet &lt;EM&gt;class_1&lt;/EM&gt; on Alice it takes me to &lt;EM&gt;sheet class_2&lt;/EM&gt;,&amp;nbsp;&lt;EM&gt;cell A3&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1675079280473.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79914i6A9D0E7EA322BF52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1675079280473.png" alt="Patrick_0-1675079280473.png" /&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_1-1675079317943.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79915i25E7F8DBC1844EBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_1-1675079317943.png" alt="Patrick_1-1675079317943.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 11:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856220#M26168</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-01-30T11:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Hyperlink cells in one sheet to cells in another sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856263#M26169</link>
      <description>&lt;P&gt;I think you need to put&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;C1ToC2_ref&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the column statement before NAME.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 15:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856263#M26169</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2023-01-30T15:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Hyperlink cells in one sheet to cells in another sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856362#M26171</link>
      <description>&lt;P&gt;Ooooh! Variable order matters! Yep, that did the trick.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1675117825245.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79940iD1B1036891111964/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1675117825245.png" alt="Patrick_0-1675117825245.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 22:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Hyperlink-cells-in-one-sheet-to-cells-in-another/m-p/856362#M26171</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-01-30T22:31:01Z</dc:date>
    </item>
  </channel>
</rss>

