Hello,
I have a deployed SAS job runs in flow which always fails during the first run and after we re -run manually it will get succeeded. The issue is due to sql server stored procedure which we call in it in the SAS job.
So we thought of adding exception handling in the schedule manager for that job. We have defined that 'if the job fails with exit code greater than zero, we asked it to re-run automatically', But its not working. Is there any other way to remove the manual process of re run ?
Thanks
I suggest you talk with your SQL Server database administrator to see if you can get the stored procedure fixed. It's always better to cure the disease rather than treat the symptoms.
What sort of problem does SAS report with the stored procedure?
If the procedure is taking too long to respond to data request from SAS perhaps you just need to add a bit of code to have SAS wait for the procedure.
Or maybe your connection options between SAS and SQL Server need to be tweeked a bit.
Does the job exit with an error or a warning?
If it's an error i'll agree with the other suggestions to fix the error by its source.
If it' a warning, and you want to allow your batch-flows to complete with a warning, then you can edit the sasbatch.bat file.
\SAS\Config\Lev1\SASApp\BatchServer\sasbatch.bat
Just remove the REM in the last four lines as stated in the comments in the file.
This is on a windows platform but I assume that you can do something similar if it's another platform.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.