摘要:SAS GRAPH导出图片文件
1、一般图片
code:
filename gifout "C:\sasdata\demo.gif";
goptions reset=all device=gif gsfname=demo gsfmode=replace;
proc gplot data=resdat.idx000001 gout=work.graph;
symbol1 v=none i=join c=blue;
title1;
title2 "time series ";
plot clpr * date;
run;
quit;
--------------------------------------------------------------------------------------
2、gif图片
code:
/* Create file references for the output */
filename gifout "gifanim3.gif"; /* Image output */
/* Create catalog Mygraphs */
libname Mygraphs "C:\";
/* Set the graph style */
ods listing style=harvest;
/* Delete the previously created graphs before creating new ones */
proc greplay igout=Mygraphs.Sales nofs;
delete _all_;
run;
quit;
/* Create our data set by sorting sashelp.prdsale by product */
proc sort data=sashelp.prdsale out=Work.sales;
by product;
run;
quit;
/* Set graphics options */
goptions reset=all device=gif noborder nodisplay;
/* Generate the graphs */
title1 "1993 Sales";
proc gchart data=work.sales(where=(year=1993)) gout=Mygraphs.Sales;
pie3d country / sumvar=actual type=mean;
by product;
run;
quit;
/* Specify the replay options */
goptions reset=all device=gifanim noborder
disposal=background /* Restore the background between images */
delay=200 /* Wait 2 seconds between each image (200 x 0.01s) */
gsfname=gifout gsfmode=replace;
/* The graphs are to be replayed in the following product order: */
/* desks, tables, chairs, sofas, and beds */
/* This means that we have to replay the GRSEGs in the following order: */
/* GCHART2, GCHART4, GCHART1, GCHART3, and GCHART */
/* Replay the first graph */
proc greplay igout=Mygraphs.Sales nofs;
replay GCHART2;
run;
quit;
/* Set the GSFMODE= graphics option to append the remaining graphs */
goptions gsfmode=append;
/* Replay the remaining graphs */
proc greplay igout=Mygraphs.Sales nofs;
replay GCHART4 GCHART1 GCHART3 GCHART;
run;
quit;
/* Write the trailer to the animated GIF file. */
/* Since we used BY-group processing, use a DATA step */
data _null_;
file gifout recfm=n mod;
put "3B"x;
run;
-----------------------------------------------------------------------------
问题:
不知道为什么不能生成指定文件名到指定目录,请教各位大侠,谢谢。