07-18-2016 06:28 AM
I'm using DDE and the code is
filename a dde 'Book1|H:\test!R1C1:R3C4';
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??
07-18-2016 07:13 AM
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,
07-18-2016 08:20 AM - edited 07-18-2016 08:21 AM
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.