BookmarkSubscribeRSS Feed
Willempie
Calcite | Level 5
Greetings.

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?
10 REPLIES 10
GraphGuy
Meteorite | Level 14
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?

Is there anything else in the SAS log?
Willempie
Calcite | Level 5
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.
GraphGuy
Meteorite | Level 14
Hmm...

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?
Willempie
Calcite | Level 5
We're running SAS 9.1.3 SP 4 under zOS 1.10.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
And, for your batch job, your DEVICE= OPTIONS/GOPTIONS setting is set to? Verify in your batch job with PROC OPTIONS OPTION=DEVICE; RUN;

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

batch chart device z/os site:sas.com
Willempie
Calcite | Level 5
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?
GraphGuy
Meteorite | Level 14
Does it work if you specify a goptions device= ?
DanH_sas
SAS Super FREQ
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.

Thanks!
Dan
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
No doubt you will get some extra mileage by contacting your SAS z/OS (IBM mainframe) administrator for guidance.

Scott Barry
SBBWorks, Inc.
Willempie
Calcite | Level 5
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.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 3056 views
  • 0 likes
  • 4 in conversation