BatchRunner.StartJob


Userlevel 3
Badge +2

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

BatchRunner.StartJob

The BatchRunner.StartJob() method was deprecated in USoft 8 and is supported only for backward compatibility. Use BatchRunner.job methods instead.

The StartJob method cannot be called from a constraint.

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

The job parameters must be named. The JobName parameter is required. Using JobParameter items, you can pass parameters to the job. 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.

BatchRunner.StartJob() returns 0 if successful.


3 replies

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?

Userlevel 3
Badge +2

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