04-13-2017 02:58 PM
I automated SAS Enterprise Guide program by generating a VBScript and scheduled it with the task scheduler. This automated task should run daily, but somehow the task seems not stable. Most of the time it ran, sometimes (some random day, happen once a week or every two weeks randomly) it did not. I could not figure out the reason for it.
1) I am using SAS server on Linux;
2) I used the windows task scheduler to schedule to VBScript at daily frequency.
3) In the SAS Enterprise code, I need to access data at SQL server and output the final table to SQL server.
4) even sometime the SAS code did not run, the task schedule still shows the task run successfully. See the attachement (today the code did not run, but the task still show it runs successfully).
SSo what's the possible reason for that? SAS to SQL connnection is not stable?
04-13-2017 03:19 PM
I suspect the Task Scheduler reports "success" if it was able to send the appropriate start commands and not get an immediate error: ie SAS started.
What to the SAS logs of the incomplet runs show? I would look for messages about unable to access/connect or set not available.
Once upon a time we had issues with Windows services getting interrupted and not restarting, so the SQL Server side may have an issue similar to that.
If you can't find logs or have suppressed them for some reason I suggest making sure that each time the process runs it creates a log. At least you could indentify connection issues and diagnose other SAS specific issues.
04-19-2017 10:55 AM
Thank you! @ballardw
There is no error message in the SAS log file as the SAS program did not run at all.
It seems the Task Scheduler ran successfully but the SAS code is not triggered at all. So strange, I could not figure out the reason for that.
04-19-2017 11:22 AM
You may want to try posting the resolved command line that should be sent to SAS to start your job.
You may be missing an element. Compare to the command string properties of a SAS launching shortcut for starters. Look in the online documentation for Batch jobs for other hints.
If your SAS install is a server version then you may need additional bits to connect to the server (not sure what they may be because I don't work in server environment) and use the correct scheduler.