Good afternoon everyone,
Because I think, that scheduling in SAS Management Console has a lot of limitations, I'm trying to schedule my deployed DI jobs using powershell, which is more flexible than old vb scripts.
What I do now:
-deploy my job as before,
-create powershell file, which runs my sas file and creates a log, for now it looks like this:
$logname="C:\SAS\Config\Lev1\SchedulingServer\batchuser\SAP_RFC\Log\mylog_"+(get-date -uformat "%Y%m%d_%H%M%S").tostring()+".log"
C:\SAS\Config\Lev1\SASApp\BatchServer\sasbatch.bat -log $logname -batch -noterminal -logparm ""rollover=session"" -sysin "C:\SAS\Config\Lev1\SchedulingServer\batchuser\SAP_RFC\myprogram.sas"
When I run scheduled SAS job using the old method, I can see retun code (status) in small log from vbs script, eg:
Flow STARTING...
Job BOM_tab_A5P60HQJ_CE00000O STARTING 08/03/2020 04:00:00
Job BOM_tab_A5P60HQJ_CE00000O COMPLETE 08/03/2020 04:00:43 status=0.
Job MB51_tab_A5P60HQJ_CE00000Q STARTING 08/03/2020 04:00:43
Job MB51_tab_A5P60HQJ_CE00000Q COMPLETE 08/03/2020 04:09:05 status=0.
I can see it in Windows scheduler too (Last run result column)
My question is, how could I retrieve this value using powershell?
Thanks in advance!
Best regards,
Czarek