This is not a question, but I wish to share how to do PreCheck on the Fortra JAMS Scheduler system.
I’ve struggled a lot to get a PreCheck condition to work.
I been able a achieve it by using a PowerShell Script.
Need:
I needed to Run a specific job, base on a schedule and on a certain flag in a SQL Database. Fortra JAMS Scheduler allow this using a ProCheck Job.
How to:
Create a new job that will serve as a Precheck, set the Execution Method to Powershell then as the script Source. do something like this (Sample Code):
Import-Module JAMS
Import-Module SQLServer
$result = Invoke-Sqlcmd -ServerInstance DBServerName -Database DataBasename -Query " SELECT ParamValue FROM dbo.Param WHERE ParamCode = 'ParamValue'" -Encrypt Optional
Write-Host "Log Data: "
Write-Host "Query value: $($result[0])"
if ($result[0] -gt 0)
{
$Host.SetShouldExit(0)
}
else
{
$Host.SetShouldExit(1)
}
Then from the Job that need to be Run with that PreCheck, goto Schedule Tab, click Add => “This Job Depends on a …” => “Precheck Job”. Then Select the precheck to you just create.
thanks for listening.
Hugo
Hope that ca help someone, the Documentation on JAMS Product is VERY limited