BookmarkSubscribeRSS Feed
Nivas88
Calcite | Level 5

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 

4 REPLIES 4
gwootton
SAS Super FREQ
Your solution of running the job again if it fails sounds valid. Do you have any details on how it isn't working?
Could you modify your code to retry a failed call to the stored procedure?
--
Greg Wootton | Principal Systems Technical Support Engineer
SASKiwi
PROC Star

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.

ballardw
Super User

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.

CHandberg
Obsidian | Level 7

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.

 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

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.

Discussion stats
  • 4 replies
  • 467 views
  • 1 like
  • 5 in conversation