ODS图形选项可生成更好的图形,但似乎比基本图形长800倍。我通过各种不同的程序体验过这一点。 Windows 7上的平台是SAS 9.4。
Q1:这是典型/预期的吗?去年,我可以在同事的机器上以更快的速度制作ODS图表。
Q2:我如何加快速度,现在我可以比ODS图形更快地手动创建图表。基本的图表也不够专业,也许如果有一种方法可以使用抗锯齿字体自动将它们导出为体面的png或svg格式? (请记住,我想编写一个自动创建数千个图表的程序。)
问题3:我应该放弃ODS图形并切换回传统图形吗?
以下示例。如果你执行这段代码并查看日志中的执行时间,那么在ODS图形关闭的情况下,我会看到0.09秒的休假过程,在ODS图形打开的情况下,我会看到1:13.11秒甚至1:20.23秒。如果我另外请求html输出,则每个图表可能需要超过2分钟。
/**********************************************************
Example illustrating ODS vs base graphics runtimes.
ODS takes orders of magnitude longer.
***********************************************************/
data jets;
input Engine Diam @@;
label Engine = "Engine Number";
datalines;
1 78.4 2 80.1 3 84.4 4 79.1 5 80.4
6 83.5 7 73.8 8 83.5 9 75.0 10 76.8
11 70.5 12 80.3 13 82.4 14 79.4 15 86.4
16 90.5 17 77.7 18 82.5 19 79.9 20 83.2
;
/**********************************************************
ODS Graphics off
***********************************************************/
ods graphics off;
title 'Individual Measurements and Moving Range Charts';
title2 'Jet Engine Diameters (cm)';
proc shewhart data=Jets;
irchart Diam*Engine;
run;
/**********************************************************
ODS Graphics on
***********************************************************/
ods graphics on;
title 'Individual Measurements and Moving Range Charts';
title2 'Jet Engine Diameters (cm)';
proc shewhart data=Jets;
irchart Diam*Engine;
run;
/**********************************************************
ODS Graphics on, ODS HTML
***********************************************************/
ods html file="irchart.html" path=gout style=STATISTICAL;
title 'Individual Measurements and Moving Range Charts';
title2 'Jet Engine Diameters (cm)';
proc shewhart data=Jets;
irchart Diam*Engine;
run;
ods html close;
ods graphics off;
日志:
551 /**********************************************************
552 Example illustrating ODS vs base graphics runtimes.
553 ODS takes orders of magnitude longer.
554 ***********************************************************/
555 data jets;
556 input Engine Diam @@;
557 label Engine = "Engine Number";
558 datalines;
NOTE: SAS went to a new line when INPUT statement reached past the end of a
line.
NOTE: The data set WORK.JETS has 20 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
563 ;
564
565 /**********************************************************
566 ODS Graphics off
567 ***********************************************************/
568 ods graphics off;
569 title 'Individual Measurements and Moving Range Charts';
570 title2 'Jet Engine Diameters (cm)';
571 proc shewhart data=Jets;
572 irchart Diam*Engine;
573 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used
to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: 48462 bytes written to C:\Users\carda10\sasgraph.svg.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 0.09 seconds
cpu time 0.07 seconds
574
575 /**********************************************************
576 ODS Graphics on
577 ***********************************************************/
578 ods graphics on;
579 title 'Individual Measurements and Moving Range Charts';
580 title2 'Jet Engine Diameters (cm)';
581 proc shewhart data=Jets;
582 irchart Diam*Engine;
583 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used
to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 1:09.06
cpu time 1.20 seconds
584
585 /**********************************************************
586 ODS Graphics on, ODS HTML
587 ***********************************************************/
588 ods html file="irchart.html" path=gout style=STATISTICAL;
NOTE: Writing HTML Body file: irchart.html
589 title 'Individual Measurements and Moving Range Charts';
590 title2 'Jet Engine Diameters (cm)';
591 proc shewhart data=Jets;
592 irchart Diam*Engine;
593 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used
to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 1:11.89
cpu time 1.31 seconds
594
595 ods html close;
596 ods graphics off;
更新:我认为这与打印机(物理)访问有关。
答案 0 :(得分:0)
原来这与打印机访问有关。
我注意到在其他桌面应用程序中,有时需要大约20秒才能访问远程默认打印机。
其次,我还注意到当我在可以访问打印机的网络上时,生成每个图表所花费的时间要少得多。
然后我将我的默认打印机切换为人造adobe pdf生成器。这将图表生成时间从1-2分钟缩短到0.09秒。
通过切换回无法访问的网络打印机可以重现效果,并通过切换离开网络打印机再次解决。
因此,每当生成图表时,PROC SHEWHART和其他操作都会延迟并等待联系网络打印机,即使它没有进入打印机。