BookmarkSubscribeRSS Feed
lei
Obsidian | Level 7 lei
Obsidian | Level 7

Hi,

 

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.

 

Thank you.

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

lei
Obsidian | Level 7 lei
Obsidian | Level 7

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?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

LinusH
Tourmaline | Level 20
Adding to the options put forward by @RW9, the Addin for MS Office will give you a great deal of power to design your Excel report.
Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4779 views
  • 0 likes
  • 3 in conversation