Job Submit – Source Reference
The Job Submit <Job> element can be used to start a JCL job at the host and wait until it completes. This can be useful to setup or teardown a test scenario. The test Scenario will fail if the job fails.
Syntax
The syntax of the Job element is:
jobLocation="JOBDEFINITIONID">
jobcc="<true/false>" jclstepcc="<value>" mainprogramcc="<value>"
jobnamecc="<name>" programtype="<type>"
returnCodeVerify="<value>" systemAbendCodeVerify="<value>"
userAbendCodeVerify="<value>">
<Content><![CDATA[<JCL STATEMENTS>]]></Content>
</Job>
The Job name attribute is used for visually showing the job in editors as well as writing information in the execution log. The haltExecution indicates whether to stop execution of the test case when there is a verification error. The jobDefinitionId references a Job Definition in the repository. The jobLocation values will change depending on the selected Job location:
- For option Job Definition ID the jobLocation values will be "JOBDEFINITIONID"
- For option File/Dataset Name the jobLocation value will be “DATASET”
- For option Specify JCL the jobLocation value will be "JOBDEFINITION"
Code coverage options:
- jobcc indicates whether code coverage has been selected.
- jclstepcc - The step in the job where code coverage is going to be collected.
- mainprogramcc - The main program where code coverage is going to be collected.
- jobnamecc - If you use the Job definition ID, Dataset name, or Specify JCL option using a JOB card, it will match with the supplied Jobname in the job. In the case of using the Specify JCL option without a JOB card, the default job card provided uses the userid only.
- programtype - Specifies program type Batch, Db2, or IMS.
Verify options:
returnCodeVerify - Specifies the expected return code or return code expression.
systemAbendCodeVerify - Specifies the expected system abend system abend expression.
userAbendCodeVerify - Specifies the expected user abend user abend expression.
Content:
The Content element contains the JCL to execute. The JCL should be encapsulated in an XML CDATA element to avoid an XML parser to reformat the JCL. The JCL can be any JCL used for submitting jobs, but the Job card definition should be excluded for options the JCL defined by ID or specified JCL as the Non-virtualized Test Host server dynamically creates this.
The third option is to use the File/Dataset Name option. This option will execute a JCL located at the host. The JCL can be located in a data set member like KS.SANDBOX.DEV1.JCL(XADJOB01) or a JCL located in a sequential data set like KS.SANDBOX.DEV1.SEQJCL or a JCL located in a file in USS file path like /u/jcldir/myjcl.txt. If the option File/Dataset Name is selected the Job card definition must be included in the JCL at the host.
When using the graphical editor, it is possible to drag&drop a job definition ID from the repository view directly into the test scenario.
Example 1
Example 1 shows a JobInfo element specifying JCL to execute a program. At runtime, the JCL will be submitted and the test scenario will continue when the job has completed.
<Content><![CDATA[//IEFBR14 EXEC PGM=IEFBR14
//SYSOUT DD SYSOUT=*]]></Content>
</Job>
Example 2
Example 2 shows a Job that will use the JCL specified for a Job Definition in the repository.
jobLocation="JOBDEFINITION">
<Content />
</Job>
Example 3
Example 3 shows a Job that will use the File/Dataset Name to execute a JCL located at the mainframe.
datasetName="KS.SANDBOX.DEV1.JCL(XADJOB01)" jobLocation="DATASET">
<Content />
</Job>
Variable substitution
Variable substitution can be used for options JOBDEFINITION and JOBDEFINITIONID. If a variable is defined like this:
jcl">KS.SANDBOX.DEV1.JCL(XADJOB01)</Variable>
The variable will be substituted in options JOBDEFINITION and JOBDEFINITIONID by using this syntax ${jcldataset}.