BookmarkSubscribeRSS Feed
KBACHU
Fluorite | Level 6

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;

3 REPLIES 3
TomKari
Onyx | Level 15

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

LinusH
Tourmaline | Level 20
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
Ksharp
Super User
Try this one . after executing , open log.txt

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 4356 views
  • 1 like
  • 4 in conversation