Help using Base SAS procedures

Error

Reply
Frequent Contributor
Posts: 90

Error

Hi,

I am trying to export the data by using DDE but getting error as below,

ERROR: DDE session not ready.
FATAL: Unrecoverable I/O error detected in the execution of the data step program.Aborted during the EXECUTION phase.

But I ran the same program on another machine , its getting exported without any errors.

Please let me know how to solve this error.

Thanks in Advance . Message was edited by: raveena
PROC Star
Posts: 1,236

Re: Error

Hi,
Can you tell us more? Are you using DDE to connect to word, excel, powpoint.? Is the same verion of MS whatever installed on both the PC where it works and the PC where itndoesnt work? Please send a section of the log showing the code you submitted and the error message.
--Q.
Frequent Contributor
Posts: 90

Re: Error

Hi Quentin,

I am using DDE, export data to excel file. Ya, we have installed the same version of MS office. The sample code is below,
* open excel ;
%macro dde_openExcel;
options noxsync noxwait;
filename sas2xl dde 'excel|system'; * reference to open/close excel ;
data _null_;
length fid rc start stop time 8;fid=fopen('sas2xl','s');
if (fid le 0) then do;
rc=system('start excel');
start=datetime();
stop=start+10;
do while (fid le 0);
fid=fopen('sas2xl','s');
time=datetime();
if (time ge stop) then fid=1;end;
end; rc=fclose(fid); run;
%mend dde_openExcel;

%macro dde_makeWorkbook(thepath=,thefile=);
filename sas2xl dde 'excel|system';
filename DDEcmds dde 'excel|system';
data _null_;
file sas2xls;
put '[error(false)]';
put %unquote(%bquote('[save.as("&thepath.\&thefile")]')); * save as ;
run;
%mend dde_makeWorkbook;

While running this macro am getting an error.

Thanks.
PROC Star
Posts: 1,236

Re: Error

Hi,
It's still not clear to me where you get an error. Can you send the log file?

When you call the first macro it should start excel. Does it work?

It looks like the second macro just tells execel to save the file. Excel has to be running in order for the second macro to work.

There are plenty of DDE folks on the SAS-L listserv who could help with this too : http://www.listserv.uga.edu/archives/sas-l.html

--Q.
Ask a Question
Discussion stats
  • 3 replies
  • 195 views
  • 0 likes
  • 2 in conversation