<?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: ODS HTML in SAS Viya not working as expected in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963240#M2808</link>
    <description>&lt;P&gt;Ah. OK. If you download the files and review the HTML, you can see that SAS hard-coded the path in the src=specification for the image.&amp;nbsp; It does the same in Windows SAS. Try &lt;EM&gt;moving&lt;/EM&gt; both files to a new location in Windows and you'll see the same effect. To work around this, you'd have to edit the HTML page to change the hardcoded path to this:&lt;BR /&gt;src="./SGPlot1.png"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, as long as you place both the HTML file and the .png file in the same folder, it will work as expected.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2025 19:19:10 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2025-04-02T19:19:10Z</dc:date>
    <item>
      <title>ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963228#M2805</link>
      <description>&lt;P&gt;I can't get graphics to appear in the output file in SAS Viya with a relatively simple ODS HTML statement. This works fine in SAS 9.4, but doesn't work the same in SAS Viya.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file='print.html' path="&amp;amp;_userhome" gpath="&amp;amp;_userhome";

proc print data=sashelp.class;
run;

proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output folder &amp;amp;_userhome exists. The output HTML file shows PROC PRINT output but not PROC SGPLOT output. How to fix?&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="PaigeMiller_0-1743616149075.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105842i365BD0409A3F98A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PaigeMiller_0-1743616149075.png" alt="PaigeMiller_0-1743616149075.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 18:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963228#M2805</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-02T18:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963237#M2806</link>
      <description>&lt;P&gt;What version of SAS Viya are you using? I ran this code in Viya 2025.01&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file='print.html' path="&amp;amp;_userhome" gpath="&amp;amp;_userhome";
proc print data=sashelp.class(obs=5);
run;
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and got the expected result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASJedi_0-1743620335271.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105843i9BF654F70896C35F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASJedi_0-1743620335271.png" alt="SASJedi_0-1743620335271.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The code also produced the expected results in Viya for Learners (&lt;SPAN&gt;LTS 2024.09).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 19:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963237#M2806</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2025-04-02T19:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963238#M2807</link>
      <description>&lt;P&gt;No, that's not what I am asking about. You are looking at the results tab in Viya, whereas I am looking at the results in the output file named print.html opened in my web browser. In the results tab, I see the plot like you do, but it is not there in the print.html file.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 19:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963238#M2807</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-02T19:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963240#M2808</link>
      <description>&lt;P&gt;Ah. OK. If you download the files and review the HTML, you can see that SAS hard-coded the path in the src=specification for the image.&amp;nbsp; It does the same in Windows SAS. Try &lt;EM&gt;moving&lt;/EM&gt; both files to a new location in Windows and you'll see the same effect. To work around this, you'd have to edit the HTML page to change the hardcoded path to this:&lt;BR /&gt;src="./SGPlot1.png"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, as long as you place both the HTML file and the .png file in the same folder, it will work as expected.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 19:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963240#M2808</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2025-04-02T19:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963241#M2809</link>
      <description>&lt;P&gt;It sounds as if you are saying there is no way to write an ODS HTML command and have this work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's true, this is very disappointing. In all my years of working in Base SAS, I have found it very helpful to write output including graphics to a particular folder with a specific file name, and keep everything together that way, all done via SAS code. If that isn't possible in Viya, this is a major hit to my normal workflow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I await to hear from others if this is possible.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 19:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963241#M2809</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-02T19:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963281#M2810</link>
      <description>&lt;PRE&gt;%let _userhome=c:\temp\z ;

ods html &lt;STRONG&gt;body='print.html'&lt;/STRONG&gt; path="&amp;amp;_userhome" gpath="&amp;amp;_userhome";

proc print data=sashelp.class;
run;

proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;

ods html close;&lt;/PRE&gt;
&lt;P&gt;Also try HTML5 instead of HTML :&lt;/P&gt;
&lt;PRE&gt;ods &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;html5&lt;/STRONG&gt; &lt;/FONT&gt;&lt;STRONG&gt;body=&lt;/STRONG&gt;'print.html' path="&amp;amp;_userhome" gpath="&amp;amp;_userhome";&lt;BR /&gt;............&lt;BR /&gt;ods &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;html5&lt;/STRONG&gt; &lt;/FONT&gt;close;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Apr 2025 01:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963281#M2810</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-04-03T01:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963306#M2811</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;, but neither of these produce the desired plot in print.html using my SAS Viya.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 11:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963306#M2811</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-03T11:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML in SAS Viya not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963397#M2812</link>
      <description>&lt;P&gt;Solution provided by SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html5 file="&amp;amp;_userhome./print2.html" options (bitmap_mode='inline'); 
proc print data=sashelp.class; 
run; 

proc sgplot data sashelp.class; 
scatter x-height y=weight; 
run; 
ods html5 close; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Apr 2025 10:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/ODS-HTML-in-SAS-Viya-not-working-as-expected/m-p/963397#M2812</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-04T10:43:35Z</dc:date>
    </item>
  </channel>
</rss>

