2

I use ods html to output HTML code from SAS to body=_webout. SAS version is 9.4. I would like to output a HTML table, but SAS generates automatically an additional table around the output of each ods html statement. For example this is my SAS code:

ods html text="<table id='test'>";

And this is the generated HTML code:

<table width="100%" style=" border: 0px solid #000000; border-spacing: 0px;" cellspacing="0" cellpadding="0" rules="none" frame="void">
   <tr>
      <td class="l usertext">**<table id='test'>**</td>
   </tr>
</table>

Is there an option to suppress the additional code from printing by SAS? With SAS 9.2 and the same code there was not such an effect.

4

1 回答 1

2

我猜 SAS 这样做是为了确保 ODS html 输出之间的格式一致。

我们用来确保我们得到我们想要的东西的一种解决方法是在这种情况下简单地使用数据步骤。datastep 可以写入保留的文件名 _webout,只要它作为 Web 请求的一部分运行:

data _null_;
  file _webout;
  put "<table id='test'>";
run;

像这样写的_webout时候不需要ODS html声明。

于 2015-06-05T14:19:38.170 回答