How to Find errors in external SAS Log file

Reply
Occasional Contributor
Posts: 19

How to Find errors in external SAS Log file

Hi All,

 

We have a sas application which has 15 sas programs and currently each program is being run by a person manually one after the other.

Log data for each program will be saved in a separate text file in local path.

 

Now, we need to automate the process. So in part of automation, at the end of each sas program we need to check log for any errors before we proceed to next program. process should call 2nd program only when there are no erros in log of first sas pprogram . If there are any errors in log of 1st program, it should not call 2nd program and an email notification should be done stating that there are erros in the log of first program.

 

Please help me on this.

 

Thanks in advance.

 

Thanks,

Hari.

Super User
Posts: 7,435

Re: How to Find errors in external SAS Log file

When you run SAS in batch mode, the process will end with a return code of 0 only if no ERRORs or WARNINGs were given.

You can use that return code to chain SAS calls, how you do it depends on the platform on which your SAS is installed and runs.

 

Once you reach the level of complexity you obviously have reached now, I would also consider attaching the SAS processing to the organisation's scheduling system. Schedulers are the best tool for running jobs the way you intend to.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 19

Re: How to Find errors in external SAS Log file

Hi ,

 

I will run each program between rsubmit and endrsubmit in base sas 9.4 editor. here each program is lengthy which consists multiple datasets. so now once program 1 completey runs, we need to validate whether there are any errors from entire program 1 or not. it should call program 2 only if there are no errors found else it should stop and send en email notification saying there are errors found in step 1.  This process loop should go on for all steps. Error check in log is the condition that we should add as dependency between each program.

 

what is the best way to implement this. Please suggest. can we write any macro to do this.. suggestions please.

 

 

Note: Scheduler will be used just to kick off the entire sas program. what I am thinking is put code from all sas programs in a single sas program and between each program code we need to incorporate code to check the errors in Log along with any other conditions that we have.

Frequent Contributor
Posts: 82

Re: How to Find errors in external SAS Log file

If you don't have or can't use a scheduler to do the checks you want, I'd suggest putting everything in a shell script. That way you can use that to check all of the conditions and then execute the desired follow up code.
Ask a Question
Discussion stats
  • 3 replies
  • 101 views
  • 0 likes
  • 3 in conversation