Desktop productivity for business analysts and programmers

Running a bat file from SAS EG

Reply
Contributor
Posts: 70

Running a bat file from SAS EG

I am trying to run a bat file from SAS EG and bat file has a list of SAS programs. The bat file/SAS program seems to be executing but the SAS program doesnt create a log file. Is there any way a log file can be created?

 

data _null_;

    call system("T:\Test_Bat.bat");

    x "T:\Test_Bat.bat";

run;

    %sysexec("T:\Test_Bat.bat");

run;

Trusted Advisor
Posts: 1,061

Re: Running a bat file from SAS EG

You'd need to open up the bat file, and add a log destination to the line that invokes SAS. I think the syntax is

 

-log "C:\whatever\mylog.log"

 

Tom

Esteemed Advisor
Posts: 5,202

Re: Running a bat file from SAS EG

A log is created by default, you might need to investigate where. You are talking about the individual SAS programs in the bat script, right?

It sounds like an awkward way of doing things. I can there's a need for scheduling purposes to create a bat file, but why do you need to execute it from EG?
Data never sleeps
Grand Advisor
Posts: 9,596

Re: Running a bat file from SAS EG

Try this one . after executing , open log.txt

x "T:\Test_Bat.bat > c:\temp\log.txt ";

Ask a Question
Discussion stats
  • 3 replies
  • 629 views
  • 1 like
  • 4 in conversation