Help using Base SAS procedures

Error handling in batch mode

Occasional Contributor
Posts: 19

Error handling in batch mode

I've put some SAS programs in a .bat file that runs every day. At the end of the process SAS send me an email with the log file. With which automatic macro variable could I check if there was an error in the execution? In this manner I'd avoid receiving the whole log file.

Thank you
Respected Advisor
Posts: 4,743

Re: Error handling in batch mode


Wouldn't this just be to collect the highest exit code of the SAS programs you're submitting (as part of the dos script).

As I understand it each of these programs is submitted in batch (within this .bat file). So these are a couple of child processes and there won't be a common SAS macro variable around as every single job runs in its own environment.

Alternatively you could use the Windows Task Scheduler or LSF (if installed at your site) to handle job execution and error conditions.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation