BookmarkSubscribeRSS Feed
Halaku
Obsidian | Level 7

I have a number of DIS jobs that are scheduled through Windows Scheduler and like to capture log files names (that are created under ..Lev1\SASApp\BatchServer\Logs directory) corresponding to each job into a table. Is there a method available that I can use at the end o the job to capture that? I am thinking of putting something in the 'Status Handling' part of the scheduled job.

Any help is appreciated.

Thanks.

3 REPLIES 3
Patrick
Opal | Level 21

Hi

As much as I know "Status Handling / send job status" doesn't add the log name to the status table. I believe you would have to implement this by yourself (i.e. create a job_status macro in an autocall library and then call this macro in the post-processing of the job). The DIS generated %etls_sendJobStatus() should give you a good starting point for such a macro.

How are the log names created? Are you passing them as parameter when scheduling the jobs?

Not sure in the moment how to retrieve the log name during batch execution - but I'm sure we can find out if you want to go down this path.

HTH

Patrick

Halaku
Obsidian | Level 7

Thanks Patrick,

I am interested in capturing the log file name created by the SAS at run time. I have a macro in place that is called in Job Status Handling > Condition > Custom. This captures the rc values from job and transformation and populates a record in my Oracle table.

What I like to do is also capture the lof file name and insert into a column for each job run. I am wondering if there is any run-time variable that keeps the log file information I can use to do the intended task.

Thanks,

Misbah.

nar_sas
SAS Employee

One way to try is to use the LOG option that will provide the name of the log file, which wont work if you are running interactively.  You can also specify the ALTLOG option if that helps. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1073 views
  • 0 likes
  • 3 in conversation