<?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: Enable more than 10 blocks of HTML in stored process? in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Enable-more-than-10-blocks-of-HTML-in-stored-process/m-p/564439#M5899</link>
    <description>&lt;P&gt;Yes indeed - the 'better way' would be to seperate style and content (frontend and backend) by putting your HTML / Javascript directly on the SAS Web Server (eg htdocs) and calling SAS Stored Processes via AJAX to retrieve just the data you need, when you need it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This approach is outlined here:&amp;nbsp;&amp;nbsp;&lt;A href="https://www.rawsas.com/building-web-apps-with-sas/" target="_blank"&gt;https://www.rawsas.com/building-web-apps-with-sas/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2019 11:59:12 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2019-06-07T11:59:12Z</dc:date>
    <item>
      <title>Enable more than 10 blocks of HTML in stored process?</title>
      <link>https://communities.sas.com/t5/Developers/Enable-more-than-10-blocks-of-HTML-in-stored-process/m-p/564100#M5898</link>
      <description>&lt;P&gt;I'm creating a Stored Process that iterates multiple times through a data set and shows different subsets of it via Proc Print. I'd like to have those Proc Prints be able to expanded and hidden. (They could be quite large and the users won't want to scroll through them all the time.) I've got HTML code that does the hiding/expanding but including it via &lt;STRONG&gt;file _webout&amp;nbsp;&lt;/STRONG&gt;in my Stored Process is resulting in the &lt;EM&gt;"maximum level of nesting of macro functions exceeded"&lt;/EM&gt; error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my method for displaying a mixture of HTML and SAS ODS results has a hard cap of 10 HTML blocks. I'm therefore wondering if there is a better way of doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is SAS code of what I'm trying to do using the SASHELP Baseball library (as I can't put my actual code on here):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file _webout;
  put '  &amp;lt;HTML&amp;gt;';
  put '  &amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Expandable Blocks Test 1&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt;';
  put '  &amp;lt;BODY&amp;gt;&amp;lt;H1&amp;gt;Expandable Blocks Test 1&amp;lt;/H1&amp;gt;';
  put '  &amp;lt;p&amp;gt;Beginning of test&amp;lt;/P&amp;gt;';	
  put '  &amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;';
  put '	&amp;lt;style&amp;gt;';
  put ' .accordion { background-color: #eee; color: #444; cursor: pointer; padding: 18px; width: 100%; border: none; text-align: center; outline: none; font-size: 18px; transition: 0.4s; }';
  put ' .active, .accordion:hover { background-color: #ccc; }';
  put ' .panel { padding: 0 18px; display: none; background-color: white; overflow: hidden;}';
  put '	&amp;lt;/style&amp;gt;';
run;
 
%macro ListPlayers(team);

    Title1 "&amp;lt;H1&amp;gt;This &amp;lt;i&amp;gt;is &amp;lt;/i&amp;gt; &amp;amp;team !&amp;lt;/H1&amp;gt;"; 

%STPEND; 
data _null_;
  file _webout;
  put '&amp;lt;button class="accordion"&amp;gt;Team List&amp;lt;/button&amp;gt;&amp;lt;div class="panel"&amp;gt;';
run;
%STPBEGIN;

	 proc print data=sashelp.Baseball;
        where team="&amp;amp;team";
    run;

%STPEND; 
data _null_;
  file _webout;
  put '&amp;lt;/div&amp;gt;';
run;
%STPBEGIN;

%mend;


%macro LoopTeams;

    proc sql;
        Select  distinct(Team)
        into    :TeamName1-
        From    sashelp.baseball
        Order by Team Asc;
    quit;

    %local i;

    %do i=1 %to &amp;amp;sqlobs;
        %ListPlayers(&amp;amp;&amp;amp;TeamName&amp;amp;i);
    %end;

%mend;

%STPBEGIN;

%LoopTeams;

%STPEND; 

;*';*";*/;quit; 

data _null_;
  file _webout;
  put'	&amp;lt;script&amp;gt;';
  put'	var acc = document.getElementsByClassName("accordion");';
  put'	var i;';
  put'	for (i = 0; i &amp;lt; acc.length; i++) {';
  put'	  acc[i].addEventListener("click", function() {';
  put'		this.classList.toggle("active");';
  put'		var panel = this.nextElementSibling;';
  put'		if (panel.style.display === "block") {';
  put'		  panel.style.display = "none";';
  put'		} else {';
  put'		  panel.style.display = "block";';
  put'		}';
  put'	  });';
  put'	}';
  put'	&amp;lt;/script&amp;gt;';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If anyone can help that would be great. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 14:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Enable-more-than-10-blocks-of-HTML-in-stored-process/m-p/564100#M5898</guid>
      <dc:creator>jamesBFD</dc:creator>
      <dc:date>2019-06-06T14:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Enable more than 10 blocks of HTML in stored process?</title>
      <link>https://communities.sas.com/t5/Developers/Enable-more-than-10-blocks-of-HTML-in-stored-process/m-p/564439#M5899</link>
      <description>&lt;P&gt;Yes indeed - the 'better way' would be to seperate style and content (frontend and backend) by putting your HTML / Javascript directly on the SAS Web Server (eg htdocs) and calling SAS Stored Processes via AJAX to retrieve just the data you need, when you need it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This approach is outlined here:&amp;nbsp;&amp;nbsp;&lt;A href="https://www.rawsas.com/building-web-apps-with-sas/" target="_blank"&gt;https://www.rawsas.com/building-web-apps-with-sas/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 11:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Enable-more-than-10-blocks-of-HTML-in-stored-process/m-p/564439#M5899</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-06-07T11:59:12Z</dc:date>
    </item>
  </channel>
</rss>

