BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10

Hello,

 

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.

Nasser

 

1 ACCEPTED SOLUTION

Accepted Solutions
Nasser_DRMCP
Lapis Lazuli | Level 10

I forgot to specify that you should do

style = journal

to avoid an empty file

View solution in original post

7 REPLIES 7
WarrenKuhfeld
Rhodochrosite | Level 12

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.

 

 

Kurt_Bremser
Super User

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.

(eg

9          OPTIONS DEV=ACTIVEX;
10         GOPTIONS XPIXELS=0 YPIXELS=0;

)

Nasser_DRMCP
Lapis Lazuli | Level 10

thanks warren.

 

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 ;

run ;

ODS RTF CLOSE ;

 

Nasser_DRMCP
Lapis Lazuli | Level 10

I wonder wich device because I can notice  "ERROR: Device was not specified" in the file log

Nasser_DRMCP
Lapis Lazuli | Level 10

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

Kurt_Bremser
Super User

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.

Nasser_DRMCP
Lapis Lazuli | Level 10

I forgot to specify that you should do

style = journal

to avoid an empty file

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 2648 views
  • 0 likes
  • 3 in conversation