I am using EG3 to create a large series of graphs of which I only need some. Rather than 1 complete PDF with all graphs, is there a way I can automate production of these graphs into separate PDF files that have file names generated by the "group by" variables used in the graph code?
In essence, I have:
Page 1) Tom graph
Page 2) Rob graph
Page 3) Jan graph
but I need:
Where Tom, Rob, and Jan are possible values in my Groub By variable.
Hi...if you use a code node in EG, you can "sort" of generate the separate PDF files. There's an upside and a downside. The upside is that if you use NEWFILE=BYGROUP, the files get created automatically. The downside is that you can only "sort of" control the name of the file. For example, with the attached code:
proc sort data=sashelp.prdsale out=prdsale;
by division prodtype;
options orientation=landscape topmargin=1in bottommargin=1in
rightmargin=1in leftmargin=1in nodate number pageno=1;
ods pdf file="c:\temp\GRFBY1.pdf" newfile=bygroup;
GOPTIONS reset=all device=actximg;
PROC GCHART DATA=prdsale;
title 'The Graph Title';
VBAR3D region / SUMVAR=actual
BY division prodtype;
format actual dollar12.2;
ods _all_ close;
If the SAS dataset has 4 BY groups, then the PDF output files will be named: GRFBY1.PDF, GRFBY2.PDF, GRFBY3.PDF, GRFBY4.PDF -- which means you can control the "beginning" part of the name, but NEWFILE= option wants to number the output files by incrementing the right-most number in the starting file name by 1 for each BYGROUP (in this example). Of course, after the files were created in c:\temp, you could go and issue a RENAME to name them what you wanted.
Your only other alternative would be to "macroize" the program to produce a single BY group -- and then you can control the name of every BY group's file -- when you invoke the macro program for each group. And then you could call the files Tom.PDF, Rob.PDF and Jan.PDF. (or whatever else you wanted).