Understanding the xJCL
This section gives an overview of the various elements that make up an xJCL batch job. XML is provided for each section of the batch job followed by a description of the elements and their properties.
xJCL is an XML based Job Control Language, and is used in a similar manner to MVS JCL. xJCL describes the steps of a Java batch job and the input and output data for each step. xJCL has elements for expressing all of the information needed to define a batch job. The xJCL definition of a job is not part of the batch application, but is constructed separately and submitted to the job scheduler to run. The job scheduler uses information in the xJCL to determine where and when to run the job.
For a fully worked example see Creating xJCL for the sample batch job.
Job
<job xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://core.wcg.etools.ibm.com/xsd/xJCL.xsd" name="[IDENTIFIER]">
</job>- Change
[IDENTIFIER]to the name of your application as specified in the batch-containerconfig.xml.
Job scheduler information
<job-type>Batch</job-type>
<step-scheduling-criteria>
<scheduling-mode>sequential</scheduling-mode>
</step-scheduling-criteria> Batchandsequentialare the only options available and both must be specified.
Checkpoint algorithm
<checkpoint-algorithm name="[IDENTIFIER]">
<classname>[QUALIFIEDCLASSNAME]</classname>
</checkpoint-algorithm> - Change
[IDENTIFIER]to a logical name for your checkpoint algorithm. - Change
[QUALIFIEDCLASSNAME]to the full name of the checkpoint algorithm implementing class.
Results algorithms
RC=0 by default.<results-algorithms>
<results-algorithm name="[IDENTIFIER]">
<classname>[QUALIFIEDCLASSNAME]</classname>
</results-algorithm>
</results-algorithms> - Change
[IDENTIFIER]to a logical name for your results algorithm - Change
[QUALIFIEDCLASSNAME]to the full name of the implementing class for the result algorithm. You can use the suppliedjobsumalgorithm or create a custom algorithm. Properties are passed with a<props>section within the<results-algorithm>section.
jobsum,
requires no additional properties.Job step
<job-step name="[JOBSTEPNAME]">
<classname>[QUALIFIEDCLASSNAME]</classname>
<checkpoint-algorithm-ref name="[IDENTIFIER]"/>
<results-ref name="[IDENTIFIER]"/>
</job-step> - Change
[JOBSTEPNAME]to a logical name for your job step. - Change
[QUALIFIEDCLASSNAME]to the full name of the Java class representing the business logic of the job step, implementing the BatchJobStepInterface. - Change
[IDENTIFIER]forcheckpoint-algorithm-ref name, to the name specified in the Checkpoint Algorithm section. - Change
[IDENTIFIER]forresults-ref name, to the name specified in a Results Algorithm section.
Batch data streams
<batch-data-streams>
<bds>
<logical-name>[IDENTIFIER]</logical-name>
<impl-class>[QUALIFIEDCLASSNAME]</impl-class>
</bds>
</batch-data-streams> - Change
[IDENTIFIER]to the name of the stream as specified in the application's implementing class. The name must be unique. - Change
[QUALIFIEDCLASSNAME]to the full name of a supplied or custom class name for the data stream.
Properties
<props>
<prop name="[NAME]" value="[VALUE]"/>
</props> - Add any optional or required properties in the
<props>section, changing[NAME]and[VALUE]as appropriate
Example
You can copy this example and paste it into your editor, then make the changes described in the preceding text.
<?xml version="1.0" encoding="ASCII"?>
<job xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://core.wcg.etools.ibm.com/xsd/xJCL.xsd" name="[NAMEOFAPPLICATION]">
<job-type>Batch</job-type>
<step-scheduling-criteria>
<scheduling-mode>sequential</scheduling-mode>
</step-scheduling-criteria>
<checkpoint-algorithm name="[IDENTIFIER]">
<classname>[QUALIFIEDCLASSNAME]</classname>
<props>
<prop name="[NAME]" value="[VALUE]"/>
</props>
</checkpoint-algorithm>
<results-algorithms>
<results-algorithm name="[IDENTIFIER]">
<classname>[QUALIFIEDCLASSNAME]</classname>
</results-algorithm>
</results-algorithms>
<job-step name="[JOBSTEPNAME]">
<classname>[QUALIFIEDCLASSNAME]</classname>
<checkpoint-algorithm-ref name="[IDENTIFIER]"/>
<batch-data-streams>
<bds>
<logical-name>[IDENTIFIER]</logical-name>
<impl-class>[QUALIFIEDCLASSNAME]</impl-class>
<props>
<prop name="[NAME]" value="[VALUE]"/>
</props>
</bds>
<bds>
<logical-name>[IDENTIFIER]</logical-name>
<impl-class>[QUALIFIEDCLASSNAME]</impl-class>
<props>
<prop name="[NAME]" value="[VALUE]"/>
</props>
</bds>
</batch-data-streams>
<props>
<prop name="[NAME]" value="[VALUE]"/>
</props>
<results-ref name="[IDENTIFIER]"/>
</job-step>
</job>