<?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: Creating a user-defined HTML-Output. in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18971#M3680</link>
    <description>That's a very interesting example.&lt;BR /&gt;
But my problem is, that i don't need a storaged file. &lt;BR /&gt;
The HTML-Code should be streamed by an Stored Process; like using the "file print" statement without creating the ODS HTML-Structure.</description>
    <pubDate>Wed, 21 May 2008 06:15:30 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-05-21T06:15:30Z</dc:date>
    <item>
      <title>Creating a user-defined HTML-Output.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18969#M3678</link>
      <description>Hi. There's a "little" problem i can't solve.&lt;BR /&gt;
&lt;BR /&gt;
I have to create a user-defined HTML-Output (e.g. for an Input-User-Interface).&lt;BR /&gt;
At first i tried a code like these simplyfied:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
file print no_top_matter;&lt;BR /&gt;
put '';&lt;BR /&gt;
put '';&lt;BR /&gt;
put '&lt;TITLE&gt;test&lt;/TITLE&gt;';&lt;BR /&gt;
put '';&lt;BR /&gt;
put '';&lt;BR /&gt;
put test;&lt;BR /&gt;
put '';&lt;BR /&gt;
put '';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
But it didn't work. The ODS-Output also creates a HTML-Structure an the HTML-Code from the Data-Step is inserted in these structure (exactly it's inserted into an Table in the ODS-HTML-Structure).&lt;BR /&gt;
If i use a Filename-Statement to save the Html-File i became exactly what i need; only the Html-Code i've written in my Data-Step. But later the HTML-Code should be created in a Stored Process and the HTML-Output shoud be streamed to the Browser (via ODS i suppose).&lt;BR /&gt;
&lt;BR /&gt;
Is there any way to directly output the HTML-Code from the Data-Step without the ODS-HTML-Structure?</description>
      <pubDate>Tue, 20 May 2008 12:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18969#M3678</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-20T12:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a user-defined HTML-Output.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18970#M3679</link>
      <description>See if this code of mine can help you.&lt;BR /&gt;
Pay attention to the ODS statements and read the documentation about the ODS markup options I'm using&lt;BR /&gt;
[pre]&lt;BR /&gt;
%macro build_html(host);&lt;BR /&gt;
&lt;BR /&gt;
  %let configuration = &amp;amp;host.__configuration.html;&lt;BR /&gt;
  %let       buttons = &amp;amp;host.__buttons.html;&lt;BR /&gt;
  %let        graphs = &amp;amp;host.__graphs.html;&lt;BR /&gt;
&lt;BR /&gt;
  ods listing close;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;host..html";&lt;BR /&gt;
  ods chtml body = body (no_bottom_matter);&lt;BR /&gt;
  ods chtml close;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;host..html" mod;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
    file body;&lt;BR /&gt;
	put '';&lt;BR /&gt;
	put "  ";&lt;BR /&gt;
	put "  ";&lt;BR /&gt;
	put "  ";&lt;BR /&gt;
	put "";&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  ods chtml body=body (no_top_matter);&lt;BR /&gt;
  ods chtml close;&lt;BR /&gt;
  filename body clear;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;configuration";&lt;BR /&gt;
  ods htmlcss body = body (no_bottom_matter)&lt;BR /&gt;
              stylesheet = styles;&lt;BR /&gt;
  ods htmlcss close;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;configuration" mod;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
    set static.system_configuration;&lt;BR /&gt;
	where node_name = "&amp;amp;host";&lt;BR /&gt;
	by node_name;&lt;BR /&gt;
	file body;&lt;BR /&gt;
	  if last.node_name;&lt;BR /&gt;
&lt;BR /&gt;
	  put '&lt;TABLE height="100%" width="100%"&gt;';&lt;BR /&gt;
	  put '  &lt;TBODY&gt;&lt;TR&gt;';&lt;BR /&gt;
      put '    &lt;TD align="left"&gt;Server Name: ' node_name $;&lt;BR /&gt;
	  put '    &lt;/TD&gt;&lt;TD&gt;&amp;nbsp;';&lt;BR /&gt;
      put '    &lt;/TD&gt;&lt;TD align="right"&gt;data as of ' date;&lt;BR /&gt;
	  put '  &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;';&lt;BR /&gt;
	  put '    &lt;TD align="center"&gt;Vendor = ' cpu_vendor $;&lt;BR /&gt;
      put '    &lt;/TD&gt;&lt;TD align_center=""&gt;model = ' system_model $;&lt;BR /&gt;
	  if number_processors = 1 then &lt;BR /&gt;
	    put '    &lt;/TD&gt;&lt;TD align="center"&gt; ' number_processors 2. ' processor' ;&lt;BR /&gt;
	  else&lt;BR /&gt;
	    put '    &lt;/TD&gt;&lt;TD align="center"&gt; ' number_processors 2. ' processors' ;&lt;BR /&gt;
	  put '&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;';&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  ods htmlcss body=body (no_top_matter);&lt;BR /&gt;
  ods htmlcss close;&lt;BR /&gt;
  filename body clear;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;graphs";&lt;BR /&gt;
  ods htmlcss body = body (no_bottom_matter)&lt;BR /&gt;
              stylesheet = styles;&lt;BR /&gt;
  ods htmlcss close;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;graphs" mod;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
	file body;&lt;BR /&gt;
	  if fileexist("&amp;amp;base_dir\&amp;amp;host")&lt;BR /&gt;
	  then do;&lt;BR /&gt;
	    fileref="dir";&lt;BR /&gt;
        rc = filename(fileref,"&amp;amp;base_dir\&amp;amp;host");&lt;BR /&gt;
		did = dopen(fileref);&lt;BR /&gt;
		files = dnum(did);&lt;BR /&gt;
		columns = ceilz(sqrt(files));&lt;BR /&gt;
		rows = roundz(sqrt(files));&lt;BR /&gt;
        &lt;BR /&gt;
		put '&lt;SCRIPT language="JavaScript" src="https://communities.sas.com/script.js"&gt;';&amp;lt;br&amp;gt;
		put '&lt;/SCRIPT&gt;';&lt;BR /&gt;
		put '&lt;TABLE cols=" columns " rows=" rows " height="100%" width="100%"&gt;';&lt;BR /&gt;
		put '&lt;SCRIPT language="javascript" type="text/javascript"&gt;';&amp;lt;br&amp;gt;
		i=0;&amp;lt;br&amp;gt;
		do r=1 to rows;&amp;lt;br&amp;gt;
		  put "  document.write('&amp;lt;tr&amp;gt;')";&amp;lt;br&amp;gt;
		  do c=1 to columns;&amp;lt;br&amp;gt;
		    if i &amp;lt; files&amp;lt;br&amp;gt;
			then do;&amp;lt;br&amp;gt;
			  i+1;&amp;lt;br&amp;gt;
		      member = dread(did,i);&amp;lt;br&amp;gt;
              put "  document.write('&amp;lt;td&amp;gt;')";&amp;lt;br&amp;gt;
              put "  document.write('&amp;lt;a href=&amp;amp;host.\\" member $ " target=_blank&amp;gt; &amp;lt;img src=&amp;amp;host.\\" member $ "' + set_height(" rows ") + ' ' + set_width(" columns ") + '&amp;gt; &amp;lt;/a&amp;gt;')";&amp;lt;br&amp;gt;
			end;&amp;lt;br&amp;gt;
		  end;&amp;lt;br&amp;gt;
	    end;&amp;lt;br&amp;gt;
		put '&lt;/SCRIPT&gt;';&lt;BR /&gt;
        put '&lt;/TABLE&gt;';&lt;BR /&gt;
		rc = dclose(did);&lt;BR /&gt;
		rc = filename(fileref);&lt;BR /&gt;
	  end;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  ods htmlcss body=body (no_top_matter);&lt;BR /&gt;
  ods htmlcss close;&lt;BR /&gt;
  filename body clear;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;buttons";&lt;BR /&gt;
  ods htmlcss body = body (no_bottom_matter)&lt;BR /&gt;
              stylesheet = styles;&lt;BR /&gt;
  ods htmlcss close;&lt;BR /&gt;
&lt;BR /&gt;
  filename body "&amp;amp;base_dir\&amp;amp;buttons" mod;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
	file body;&lt;BR /&gt;
	  if fileexist("&amp;amp;base_dir\&amp;amp;host")&lt;BR /&gt;
	  then do;&lt;BR /&gt;
	    fileref="dir";&lt;BR /&gt;
        rc = filename(fileref,"&amp;amp;base_dir\&amp;amp;host");&lt;BR /&gt;
		did = dopen(fileref);&lt;BR /&gt;
		files = dnum(did);&lt;BR /&gt;
		columns = files+1;&lt;BR /&gt;
		width = 'width='||trim(left(put(floor(100/columns),3.)))||'%';&lt;BR /&gt;
		put '&lt;TABLE cols=" columns " width="100%"&gt;';&lt;BR /&gt;
		put '  &lt;TBODY&gt;&lt;TR align="center"&gt;';&lt;BR /&gt;
		put '    &lt;TD&gt;&lt;A href="https://communities.sas.com/"&gt;All Charts&lt;/A&gt;";&lt;BR /&gt;
		do i=1 to files;&lt;BR /&gt;
		  member = dread(did,i);&lt;BR /&gt;
		  pointer = scan(member,1,".");&lt;BR /&gt;
          put '    &lt;/TD&gt;&lt;TD&gt;&lt;A href="https://communities.sas.com/"&gt;" pointer $ '&lt;/A&gt;';&lt;BR /&gt;
		end;&lt;BR /&gt;
		put '&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;';&lt;BR /&gt;
		rc = dclose(did);&lt;BR /&gt;
		rc = filename(fileref);&lt;BR /&gt;
	  end;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  ods htmlcss body=body (no_top_matter);&lt;BR /&gt;
  ods htmlcss close;&lt;BR /&gt;
  filename body clear;&lt;BR /&gt;
&lt;BR /&gt;
  ods listing;&lt;BR /&gt;
&lt;BR /&gt;
%mend;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 20 May 2008 13:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18970#M3679</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-20T13:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a user-defined HTML-Output.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18971#M3680</link>
      <description>That's a very interesting example.&lt;BR /&gt;
But my problem is, that i don't need a storaged file. &lt;BR /&gt;
The HTML-Code should be streamed by an Stored Process; like using the "file print" statement without creating the ODS HTML-Structure.</description>
      <pubDate>Wed, 21 May 2008 06:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18971#M3680</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-21T06:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a user-defined HTML-Output.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18972#M3681</link>
      <description>Did you bother to read the documentation for ODS?  Specifically ODS CHTML? and what about the body options I am using?&lt;BR /&gt;
&lt;BR /&gt;
Perhaps you should read about SAS's web development tools/products.&lt;BR /&gt;
&lt;BR /&gt;
The main point here, is READ!  That's how we all learn to do this stuff, by reading and then trying.</description>
      <pubDate>Wed, 21 May 2008 11:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18972#M3681</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-21T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a user-defined HTML-Output.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18973#M3682</link>
      <description>Hi:&lt;BR /&gt;
When you move into the world of stored processes, you have to be very careful with your stored process. Not all of the SAS Enterprise Intelligence Platform clients -receive- HTML output. For example, the general method to create streaming output is to use:&lt;BR /&gt;
[pre]&lt;BR /&gt;
*ProcessBody;&lt;BR /&gt;
%stpbegin;&lt;BR /&gt;
...sas code...&lt;BR /&gt;
%stpend;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Which will tailor the output "type" appropriately for the client app. For example, the above stored process code would create varying output like this for the different client apps:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Client   Receives&lt;BR /&gt;
EG     = HTML (unless changed at the client app Options menu)&lt;BR /&gt;
PPT    = SASReport XML (only type supported by PPT)&lt;BR /&gt;
Word   = SASReport XML (unless user picks RTF or HTML as option)&lt;BR /&gt;
Excel  = SASReport XML (unless user picks CSV or HTML as optio)&lt;BR /&gt;
WRS    = SASReport XML (only type supported by WRS)&lt;BR /&gt;
Portal  = HTML (unless coded as different type, like RTF or PDF by programmer)&lt;BR /&gt;
Custom = same as portal&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
By custom, in the above, I mean a custom client app that you might develop yourself and submit the SP using your own front end application (such as Java or .NET or HTML front end).&lt;BR /&gt;
&lt;BR /&gt;
The issue of writing your own HTML with PUT statements is something that SAS/IntrNet programmers used to do. You are correct in that you can no longer use the FILE PRINT fileref. Instead you must use the _WEBOUT fileref. &lt;BR /&gt;
&lt;BR /&gt;
However, it is NOT recommended that you use PUT statements to _WEBOUT inside a stored process. This recommendation is documented in this location&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/inet2stp.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/inet2stp.html&lt;/A&gt;&lt;BR /&gt;
(which is talking about how to convert your SAS/IntrNet programs to be stored processes).  This does not come up for most people because with "new" applications, they would use this technique to write "plain" CHTML or PHTML:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
*ProcessBody;&lt;BR /&gt;
&lt;BR /&gt;
%let _odsdest=chtml;&lt;BR /&gt;
%stpbegin;&lt;BR /&gt;
...sas code...&lt;BR /&gt;
%stpend;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
OR&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
*ProcessBody;&lt;BR /&gt;
&lt;BR /&gt;
%let _odsdest=phtml;&lt;BR /&gt;
%stpbegin;&lt;BR /&gt;
...sas code...&lt;BR /&gt;
%stpend;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
and, if you wrote your own custom tagset template and stored it on the server, then you could do this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
*ProcessBody;&lt;BR /&gt;
&lt;BR /&gt;
%let _odsdest=tagsets.mycustomhtml;&lt;BR /&gt;
%stpbegin;&lt;BR /&gt;
...sas code...&lt;BR /&gt;
%stpend;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
All of the above assume that you are using a SAS stored process to generate output from some SAS process or procedure -- and that there will be output that needs the SAS ODS structure for the tabular or graph output. Your HTML with PUT statements is more like a test page -- it's not executing any code.&lt;BR /&gt;
&lt;BR /&gt;
If you need help with your Stored Process development, your best bet is to read the stored process documentation and/or look at some of these SGF papers and/or work with Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/index.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/index.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2008/024-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/024-2008.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2007/218-2007.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2007/218-2007.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2008/393-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/393-2008.pdf&lt;/A&gt;&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 21 May 2008 15:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-a-user-defined-HTML-Output/m-p/18973#M3682</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-05-21T15:45:34Z</dc:date>
    </item>
  </channel>
</rss>

