Data visualization with SAS programming

GCHART +GOUT= in batch

Reply
Occasional Contributor
Posts: 13

GCHART +GOUT= in batch

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?
SAS Employee
Posts: 967

Re: GCHART +GOUT= in batch

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?
Occasional Contributor
Posts: 13

Re: GCHART +GOUT= in batch

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.
SAS Employee
Posts: 967

Re: GCHART +GOUT= in batch

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?
Occasional Contributor
Posts: 13

Re: GCHART +GOUT= in batch

We're running SAS 9.1.3 SP 4 under zOS 1.10.
Super Contributor
Super Contributor
Posts: 3,174

Re: GCHART +GOUT= in batch

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
Occasional Contributor
Posts: 13

Re: GCHART +GOUT= in batch

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?
SAS Employee
Posts: 967

Re: GCHART +GOUT= in batch

Does it work if you specify a goptions device= ?
SAS Super FREQ
Posts: 889

Re: GCHART +GOUT= in batch

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
Super Contributor
Super Contributor
Posts: 3,174

Re: GCHART +GOUT= in batch

No doubt you will get some extra mileage by contacting your SAS z/OS (IBM mainframe) administrator for guidance.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 13

Re: GCHART +GOUT= in batch

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.
Ask a Question
Discussion stats
  • 10 replies
  • 380 views
  • 0 likes
  • 4 in conversation