06-15-2016 03:34 AM - edited 06-15-2016 03:35 AM
I am trying to run the macro attached from the University of Sidney. However, I keep on getting an error that says when trying to link to excel file
"ERROR: DDE session not ready.
FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.
Aborted during the EXECUTION phase."
Can anyone help?
I have attached the log here too.
06-15-2016 04:34 AM
Well, it could be a number of things - your working on University Edition which has different pathing, or the file doesn't exist in that location, or its not really an Excel file, or maybe you don't have MS Office installed on the SAS machine etc.
As for the code, I would advise against using DDE, it is really old, and in some circumstances does not work - nor is it supported anymore. A brief glance at the code shows it was written in 2006, some tens years ago - things have moved on quite a ways since then. I would pull out what code you really need and do it yourself.
06-15-2016 08:19 AM
Is it possible that I am on a remote server so it's not working. However, when I run the first part, excel does start up. Also, I am not using Univresity. I am on full sas.
I know DDE is old. Is there another way to export things out to specific spots in excel?
06-15-2016 08:27 AM
Yep, thats quite likely. DDE links directly to the Office install on the machine, so it generally doesn't work on networks.
As for exporting data to Excel, it depends what you mean. Odstagsets.excelxp can put outputs on specific sheets, give specific positions etc. Libname excel can also do things, but you will need to read up on them. If you have a template made in Excel - which could be anything - then its difficult to say the least and in my opinion very bad practice to be aiming things at specific cells - I mean if the template changes all your code needs to change its just bad all through. I would either generate new feiles each time from SAS based on the data, or find a way to import things into your Excel template - i.e. export from SAS using standard program, then in Excel have VBA macro which loads them into the relevant area. Although the best solution of all is to stop using Excel as its not a good fit for any purpose.
06-16-2016 02:17 AM