Skip to main content

This article is about the StartJob method of the BatchRunner internal component.

BatchRunner.StartJob

The StartJob method cannot be called from a constraint.

Runs a specific job. Allows you to pass not only input parameter values, but also input parameter names at the time of the call.

Returns 0 if successful and 1 if unsuccessful.

Syntax

INVOKE BatchRunner.StartJob WITH
SELECT
'job-name' JobName
, 'name=value' JobParameter
, ...

The required job-name names the job to be run. You can have multiple optional JobParameter items. In each of these items, name names a job input parameter and value passes it an input value.

Example

To start the EXPORT_TOURS batch job with job input parameters DESTINATION and YEAR, execute the following statement: 

INVOKE BatchRunner.StartJob WITH
SELECT
'EXPORT_TOURS' JobName
, 'DESTINATION=AUSTRALIA' JobParameter
, 'YEAR=2003' JobParameter

You can pass:

      '-quiet'             JobParameter

to run the job without displaying any information messages or prompts. Error messages are still displayed. If a log file has been specified, all the usual information is logged, irrespective of whether or not -quiet has been specified.

Will the BatchRunner.Startjob method still be supported in the Usoft 10 version or do we need to upgrade our code to the RunJob method before we upgrade to usoft 10?


StartJob will continue to be supported in USoft 10.x versions. No upgrade required.

However, RunJob or a job method (ie., Batchrunner.<job-name>) have advantages over StartJob. You can pass typed parameters as opposed to flat strings, and you can call these components from constraint SQL.


Thanks for the update.


Reply