DATA Step, Macro, Functions and more

DDE: Data Step running but Not Responding

Reply
Occasional Contributor
Posts: 5

DDE: Data Step running but Not Responding

The following are my line of codes that I've been trying to run on my SAS. Previously it was running ok with occasional error but lately I have been unsuccessful when running this code. I keep getting error where my SAS program will not respond then I will have to do a CTRL+ALT+DEL and kill the SAS program. I can't seem to decipher the error and failed to find any solution, these are just lines I copy from the Internet and it used to work fine. Can someone please enlighten me on this?

options noxwait noxsync;

x '"C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe"';

data _null_;

x=sleep(5);

run;

filename ddecmd dde 'excel|system';

data _null_;

file ddecmd;

put '[FILE-OPEN("C:\My Projects\Temp\Data Capture\CreateCSVFiles.xls")]';

run;

data _null_;

file ddecmd;

put '[FILE-CLOSE("C:\My Projects\Temp\Data Capture\CreateCSVFiles.xls")]';

put '[QUIT()]';

run;

Super User
Posts: 11,343

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

Which data step is not finishing?

Since you have 3 data steps run just one at a time to see which what may be going on as a first step.

By any chance have  you upgraded to a newer version of Office? The path to Excel would have changed.

Occasional Contributor
Posts: 5

DDE: Data Step running but Not Responding

I can get through the first data step and successfully initiate my excel 2003, so I don't think it's the path problem, but after that my program will go into an infinite loop and stop responding, or so it seems to me. The problem seems to start at the 2nd data step. In the past I am able to open up the CreateCSVFiles.xls but not sure why now I can't do that anymore. I have also tried running other similar DDE program and failed at the part where I need to open the excel file (not initiate excel program).

I have updated my Windows once, so I'm not sure if this contributes to the error.

PROC Star
Posts: 7,474

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

What are you trying to do with the files?  The code you sent: (1) starts excel; (2) opens a spreadsheet;

(3) trys to open the same spreadsheet (while the first one is still open) and then tries to quit.

Occasional Contributor
Posts: 5

DDE: Data Step running but Not Responding

My original code is longer than this and does more thing than this. Right now I'm just trying to eliminate other unnecessary codes to find out what prompted my sas program to not respond. So I realised my program will stop responding whenever it tries to open CreateCSVFiles.xls.

Valued Guide
Posts: 2,177

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

JasmineChia

have you checked that no pop-up messages appear when you open the workbook directly in excel?

peterC

Occasional Contributor
Posts: 5

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

Just an update, I realised that after I restart my computer, open the CreateCSVFiles.xls, run the program. I am able to run the program successfully after that even after I restart my SAS program.

But if I restart my computer, I need to go through the steps above again. Just wondering if anyone out there able to explain to me why this situation is happening?

PROC Star
Posts: 7,474

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

A possibly simple explanation?  DDE is finicky, at best, and requires one to know an awful lot about their system's memory, interactions between processes, etc.  Paying for Access for pc products, at least on 32-bit machines, is well worth the cost, both in terms of productivity and lack of the kind of aggrevations you've had to face during this ordeal.

Super User
Posts: 19,810

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

Try the following code, a few slight modifications that could be the issue, ie you can say open instead of file-open and the close statement doesn't need a path if its the only file you're working with.

options noxwait noxsync;

x ' "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe" ';

data _null_;

x=sleep(5);

run;

filename ddecmd dde 'excel|system';

data _null_;

file ddecmd;

put '[OPEN("C:\My Projects\Temp\Data Capture\CreateCSVFiles.xls")]';

run;

data _null_;

file ddecmd;

put '[CLOSE()]';

put '[QUIT()]';

run;

N/A
Posts: 1

DDE: Data Step running but Not Responding

Posted in reply to JasmineChia

I also had this problem after my PC upgraded to windows 7!!!!!! Now I figured out what happened.

The following solution is by the assumption that we have exacly the same problem. thx.

Are you using google chrome browser? Close it while you are running dde program! I think they are conflicted.

Don't laugh. Trust me it is the reason for my computer.

Ask a Question
Discussion stats
  • 9 replies
  • 4309 views
  • 0 likes
  • 6 in conversation