I'm trying to generate a series of graphs with GCHART into a graphics-catalog and I want to do this this in batch. Generating these graphs online poses no problems and I use code that I copied from the manual. This works:
GOPTIONS RESET=ALL GUNIT=PCT BORDER CBACK=WHITE
COLORS=(BLACK RED GREEN BLUE) FTITLE=SWISSB
FTEXT=SWISS HTITLE=6 HTEXT=4;
TITLE1 'Daily Recall Physical Mounts';
PROC GCHART DATA=PDB.MNTPHRC GOUT=PDB.VEHGRAPH;
VBAR DAY / SUMVAR=MOUNTS
OUTSIDE=SUM
WIDTH=9
SPACE=1
MIDPOINTS=1 TO 31 BY 1
;
However, when I try to run this in batch (as follows):
GOPTIONS RESET=ALL GUNIT=PCT BORDER CBACK=WHITE
COLORS=(BLACK RED GREEN BLUE) FTITLE=SWISSB
FTEXT=SWISS HTITLE=6 HTEXT=4 NODISPLAY;
TITLE1 'DAILY RECALL PHYSICAL MOUNTS';
PROC GCHART DATA=PDB.MNTPHRC GOUT=PDB.VEHGRAPH;
VBAR DAY / SUMVAR=MOUNTS
OUTSIDE=SUM
WIDTH=9
SPACE=1
MIDPOINTS=1 TO 31 BY 1
DES='DAILY RECALL PHYSICAL MOUNTS'
NAME='DRPM04'
;
I keep running into a "ERROR: DEVICE INITIALIZATION FAILED.". I must be overlooking something, but what?
This is a little out of my area of expertise, but perhaps when you're running the batch job, you also still have your interactive/DMS SAS job running, and perhaps the DMS session has the graphics-catalog locked, such that the batch job can't write to it?
No. I do allocate the database with the catalog as DISP=OLD and when I run my batchjob, there is no interactive/DMS-session active.
As for any extra messages in the SAS log, nothing. Just the usual "The SAS System stopped processing this step etc. etc. etc.", the usual end-statistics and then it ends.
Ok - I'm not sure that it makes a difference, but what version of SAS are you using (v9.1.3, v9.2, other?), and what Operating System are you running your SAS on?
A PROC OPTIONS OPTION=DEVICE; gets me the following output: DEVICE= Graphics device driver.
I guess this means that we never set a default graphics device and that I have to specify one when I run my job.
Or do I? After all, I don't want to display anything, that's for later. For now I just want to store graphics in a catalog and I always assumed that SAS would do this in a device-independent form. So who cares about the device?
A device is still needed for various pieces of information needed to create the GRSEG in the catalog. You will want to specify a device that most closely matches the way you will view the final output.
Doesn't sound unreasonable. If I don't know exactly which outputdevice I will be using and want to keep all (or as many as possible) my options open, should I go for something like a SASEMF-driver or SASMETA?
Their names at least suggest that their output will be more appropriate for various kinds of outputdevices than with any of the other drivers.