I have a macro that uses DDE to write an Excel workbook with several worksheets. The name of the workbook is a concatenation of the path name, a string constant, and a macro variable that contains the product name. I need to update the macro to add an invocation for a new product that has a slash in the name, as in %let product = 'Product This/That'. For that run, the workbook is not created, and the message in the log is
ERROR: DDE session not ready.
FATAL: Unrecoverable I/O error detected in the execution phase of the DATA step program.
Aborted during the EXECUTION phase.
I have tried %quote with the variable assignment, and the SYMBOLGEN parameter indicates that the variable is resolving correctly. I've also tried increasing the sleep time. The workbook appears to be correctly populated in my Excel display. The macro works fine for all other invocations in the SAS program, before and after this one. Does anyone have an idea about why it works for all the macro variable values except that one?
If you are on some version of windows, I don't believe that character is valid in a filename as it is the indicator for a subdirectory.
Remove SAS from the picture and try and manually create a workbook and/or sheet, called 'Product This/That' - does it work?
No, it doesn't. Thanks for the idea! I thought only a backslash would be a problem, but that showed me the forward slash doesn't work either.
If you are on some version of windows, I don't believe that character is valid in a filename as it is the indicator for a subdirectory.
You are right! I thought it would only balk at the backslash. Thanks to you and to twocanbazza! I've been trying to get past this problem for a long time.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.