The SAS Output Delivery System and reporting techniques

ODS RTF in batch mode, the file is empty

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

ODS RTF in batch mode, the file is empty

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

 


Accepted Solutions
Solution
4 weeks ago
Contributor
Posts: 28

Re: ODS RTF in batch mode, the file is empty

I forgot to specify that you should do

style = journal

to avoid an empty file

View solution in original post


All Replies
SAS Employee
Posts: 115

Re: ODS RTF in batch mode, the file is empty

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.

 

 

Super User
Posts: 6,928

Re: ODS RTF in batch mode, the file is empty

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;

)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 28

Re: ODS RTF in batch mode, the file is empty

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 ;

 

Contributor
Posts: 28

Re: ODS RTF in batch mode, the file is empty

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

Contributor
Posts: 28

Re: ODS RTF in batch mode, the file is empty

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

Super User
Posts: 6,928

Re: ODS RTF in batch mode, the file is empty

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
4 weeks ago
Contributor
Posts: 28

Re: ODS RTF in batch mode, the file is empty

I forgot to specify that you should do

style = journal

to avoid an empty file

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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