DATA Step, Macro, Functions and more

DDE save.as command works interactively but not in batch mode

Reply
Senior User
Posts: 1

DDE save.as command works interactively but not in batch mode

Hi everyone,

 

I've read that DDE is an older way to populate an Excel file, but it has been working fine until now.

 

I am running a program that has been running using Task Scheduler without any issues (Windows 7 OS).  The new PC that I am now using has been upgraded to Windows 10.  I can run the DDE process interactively without any issues, but when I am running the process through Task Scheduler, I am getting an error when the Excel file is trying to be saved.  The error is listed below the code snippet.  Does anyone have any insights or might have had a similar problem?  Is Windows 10 the issue?  The SAS version being used is 9.4 TS Level 1M4. 

 

Thank you for any help anyone can provide.

 

FILENAME HH DDE 'EXCEL|SYSTEM';
DATA _NULL_;
  FILE HH;
            
  PUT "[RUN(""&xlssheet.!MACRO1"",FALSE)]";
  PUT "[save.AS(""...\&MONTH. &today.\Audit_&&E&I...xls"")]";
  PUT '[QUIT()]';
RUN;
%END;
%mend;


ERROR: Physical file does not exist, EXCEL|SYSTEM.
NOTE: The SAS System stopped processing this step because of errors.

Super User
Posts: 7,868

Re: DDE save.as command works interactively but not in batch mode

We're not using stones and chisels anymore, so stop using DDE. It may not be dead, but it smells mighty funny.

 

Windows has the nice "feature" of running scheduled jobs in a different environment than the interactive ones (total idiocy, but that's Microsoft), so it looks as if it can't find Excel because of a missing PATH to it. Try using the absolute path to the Excel executable (starting with C:\)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 1 reply
  • 89 views
  • 0 likes
  • 2 in conversation