2

我正在尝试将 PROC TABULATE 表输出到 PNG 文件。当我有一个表语句时它工作正常,但是当我添加第二个时,只显示第一个。如何创建一个带有几个表的 PNG,就像 SAS 结果查看器中的输出一样。

%let folder=C:/Temp/;
data have;
    input username $  betdate : datetime. stake winnings;
    dateOnly = datepart(betdate) ;
    format betdate DATETIME.;
    format dateOnly ddmmyy8.;
    datalines; 
        player1 12NOV2008:12:04:01 90 -90 
        player1 04NOV2008:09:03:44 100 40 
        player2 07NOV2008:14:03:33 120 -120 
        player1 05NOV2008:09:00:00 50 15 
        player1 05NOV2008:09:05:00 30 5 
        player1 05NOV2008:09:00:05 20 10 
        player2 09NOV2008:10:05:10 10 -10 
        player2 15NOV2008:15:05:33 35 -35 
        player1 15NOV2008:15:05:33 35 15 
        player1 15NOV2008:15:05:33 35 15 
run;
PROC PRINT; RUN;

Proc rank data=have ties=mean out=ranksout groups=2;
     var stake;
     ranks stakeRank;
run;

options printerpath=png nodate nonumber;
ods printer file="&folder/PanelA.png";
PROC TABULATE DATA=ranksout NOSEPS;
    VAR stake;
    class stakerank;
    TABLE stakerank, stake*N;
    TABLE stakerank, stake*(N Mean);
RUN;
ods printer close;
ods listing;

感谢您对此的任何帮助。

4

1 回答 1

2

STARTPAGE 选项是您想要的:

options printerpath=png nodate nonumber;
ods printer file="c:\temp\PanelA.png" startpage=never;
PROC TABULATE DATA=sashelp.class NOSEPS;
    VAR height;
    class sex;
    TABLE sex, height*N;
    TABLE sex, height*(N Mean);
RUN;
ods printer close;
ods listing;
于 2013-08-19T13:56:52.353 回答