DDE error

Posts: 62

DDE error

I'm using DDE and the code is


filename a dde 'Book1|H:\test!R1C1:R3C4';

data _null_;

set t;

file a notab dlm='09'X;

put state val_A val_B val_c;



and getting error-

ERROR: Physical file does not exist, Book1|H:\test!R1C1:R3C4.



How can i resolve it??

Valued Guide
Posts: 534

Re: DDE error

In DDE you specify a so-called triplet in the filename statement. A triplet is made up of the application (Excel in your case), a topic (workbook, sheet) and an item (cell range). So your filename statement is missing the application.


Better would be (untested):


filename a dde 'Excel|Book1|H:\test!R1C1:R3C4';

Excel is supposed to be started at this time.


Hope this helps,

- Jan

Super User
Super User
Posts: 9,599

Re: DDE error

[ Edited ]



Well @jklaverstijn has given the information, basically it needs to access the Office engine.  However I would recommend that you don't go down that route.  DDE is very old (it stopped being supported pre Office 2003) and as such may not work in certain setups, or in the future.  Is there a reason why you can't report out data to a file?  Maybe you have been given a template Excel file to update (which is where the real problem lies!), if so consider having an Excel file which contains some VBA code to load CSV output from SAS and post it directly to your Excel template file.  So you would have CSV from SAS, emtpy Excel file containing macros, and Excel template file, open the Empty macro file, which would have an OnOpen function which loads your template and the CSV, updates the former and saves it.

Alternatively just produce an output file from proc report and tell them thats what they get.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation