BookmarkSubscribeRSS Feed
mschorn
Calcite | Level 5

Hi,

 

I'm trying to read the first 2 pages of multiple rtf files and put them into 1 document.  Everything I have found says I need to use dde.

I tried the following program (I've simplified it as much as possible).

 

%macro s;

%LET RC=%SYSFUNC(SYSTEM(START WINWORD));

FILENAME WORD_F DDE 'WINWORD|SYSTEM';

DATA _NULL_;

X=SLEEP(15);

RUN;

DATA _NULL_;

FILE WORD_F;

PUT '[FILEOPEN .NAME = "D:\tmp\tmp.rtf"]';

PUT '[FILECLOSEALL]';

PUT '[FILEEXIT]';

RUN;

%mend;

%s;

 

This is as simple as I could get it yet I am still getting this error:

NOTE: The file WORD_F is:

DDE Session,

SESSION=WINWORD|SYSTEM,RECFM=V,LRECL=32767

ERROR: DDE session not ready.

FATAL: Unrecoverable I/O error detected in the execution of the DATA step

program. Aborted during the EXECUTION phase.

 

 

Any ideas on what is causing this error or is there a better way than dde?

 

Thanks,

Marie

2 REPLIES 2
Reeza
Super User

Try opening the file using the full path and X command to Word and then your DDE code. 

error_prone
Barite | Level 11

I am just curious: Why do you use SAS to solve that problem?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 987 views
  • 2 likes
  • 3 in conversation