07-20-2017 04:50 AM
In a prgm I use ODS RTF and proc plot to get a graph into a file. In SAS guide It works correctly.
But whenever I launch the prgm via batch mode, then the file is empty and in the log file a message is "Device was not specified".
In the support.sas I found this "The only exception for batch processing is having output sent to the output window."
So how can I get my graph via batch mode into the output window ?
thanks in advance for your help.
07-20-2017 07:17 AM
I'm not sure I follow your question. You can certainly use ODS destination statements in batch mode to route results to files.
ods rtf file='C:\c.rtf' style=sapphire;
proc print data=sashelp.class;
ods rtf close;
The look at the results in Word.
PROC PLOT? Seriously? SGPLOT is base SAS and is much more modern.
07-20-2017 08:07 AM
You need to make sure that your batch configuration matches your Workspace Server configuration and the EG code in terms of graphic options. When you look closely at the code submitted by EG, you'll find some options that are always set by EG before your code is run.
9 OPTIONS DEV=ACTIVEX; 10 GOPTIONS XPIXELS=0 YPIXELS=0;
07-20-2017 08:35 AM
this is my code bellow. The rtf file is created but empty.I did not specified any device like
goptions ftext=zapf device=gif for example, wich device should I specify ? thanks
ODS RTF startpage = yes FILE = 'S:\Etudes Rentabilités\Rentabilité 2017\Encours Payback\NASSER\SASLOG\chroniques.rtf' style = sapphire ;
proc gplot data = BEH_SUITE_INDIC ;
format ratio percent7.0 ;
plot ratio * ANNEE_AMO_SUITE = &v_AXE. /
legend = legend1
vaxis = axis1
haxis = axis2 ;
ODS RTF CLOSE ;
07-20-2017 09:35 AM
It works ! I get a rtf file no empty, with a graph
By specifying device = png300 like this.
goptions reset = goptions device = png300 xmax=7in ymax=9in;
but I didn't manage to store the output file on windows in C:\... but only in SAS guide in a folder.maybe a FTP should be done
07-20-2017 09:39 AM
If your SAS runs on a remote server (which I presume), then you can't directly access your C:\ drive from the SAS code.
But you will find a task in EG that can transfer any file to/from the server. This can be used to download the newly created rtf to your PC.
Look in the Data menu in EG.
Need further help from the community? Please ask a new question.