sorry - been tied up...
First try using the X command (aka SYSTEM function or %sysexec macro statement).
When you are running the DDE stuff I am sure that you are doing something like
x "C:\progra~1\micros~2\Office\EXCEL.EXE" ;
run; quit;
to start up Excel
I always delete the files I am going for first (ex:
x 'del c:\SasDDETest\baseball.xls'
and then run a directory later to see what was not created by the dynamic stuff.
One of the SAS tech people (Peter) is AMAZING when it comes to DDE and macros.
Here is a sample he started me with (I changed mine a long ways to make it work, but this was a most excellent start)
options noxwait noxsync macrogen mprint symbolgen;
* deleting the newfile that we saved from previous runs of the job *;
x 'del c:\SasDDETest\baseball.xls';
filename cmds dde "excel|system";
%let drive=c;
%let rest=:\progra~1\micros~2\office\excel.exe;
%let startup=&drive&rest;
*******************************************************;
* using the string function to place the needed space *;
* to start up the excel.exe filename.xls *;
*******************************************************;
%let xlsdir=%str( c:\SasDDETest\);
*************************************************************;
* The xlsdir2 macro variable is used when the file is saved *;
* and it does not need a space *;
*************************************************************;
%let xlsdir2=c:\SasDDETest\;
* defining the original file to open *;
%let xlsfile=baseball.xls;
* defining the full string to start excel and the xls file *;
%let startup2=&startup&xlsdir&xlsfile;
%put &startup;
%put &startup2;
* defining the file that is to be saved *;
%let xlsfile1=baseball.xls;
%put &xlsfile1;
%let savefile=&xlsdir2&xlsfile1;
%put &savefile;
* %let path1=%str(%'[save.as("c:\dde\baseball3.xls"

]%');
* now lets add the save.as command to the file we are saving *;
%let saveas=%str(%'[save.as("&savefile"

]%');
* writes out the values of all the macro variables thus far *;
%put _user_;
data _null_;
call system(%unquote(%str(%'&startup2%')));
run; quit;
data test;
x=sleep(5);
run; quit;
* now lets run the saveas macro variable inside a macro *;
* the other comment is another way to do it *;
%macro saveit;
data _null_;
file cmds;
* put %unquote(%str(%'[save.as("&saveas"

]%'));
put %unquote(&saveas);
run; quit;
%mend saveit;
%saveit;
---- let me know if this stuff does not help and I will see what other directions I can help with. - j