Main Batch Programs


A main batch program is represented similarly to a called program in the repository and in a Total Test Scenario, except that it does not have a data structure and it will nearly always have specific JCL specified for setting up data sets.

To write a test scenario for a main batch program we have to setup input data and expected output as for a called program. In this case input data is data sets that are mapped to DD names. Setting the correct datasets and DD name mapping in the JCL can be done in two ways

  1. Optionally, use the Write Records element to create input and expected output data sets to be used for the component. Alternatively, use existing data sets already present at the host.
  2. Write custom JCL in the Setup JCL element of the component. This JCL will be appended to or will override the JCL defined for the component in the repository.
  3. Add DD name and Dataset name elements under the Datasets tab in the component Element Properties. This defines a DD name and a data set name and at runtime will modify the JCL defined at the component.

The actual output from the program can be verified in several ways

  • Use Verify Dataset in the Component: Output data sets can be compared to expected data sets or records and fields can be verified with expressions at the mainframe as part of the Component execution.
  • Use Verify Dataset: Output data sets can be compared to expected data sets or records and fields can be verified with expressions at the mainframe after the component execution is a separate job.
  • Use Read Dataset and Verify: Output data sets can be retrieved as plain text by a Read Dataset element and verified by an expression in a Verify element
  • Use Read Spool File and a Verify: Content of a spool file from the executed job can be retrieved as plain text by a Read Spool File element and verified by an expression in a Verify element.

Finally, it is also possible to use stubs for sub modules called by the program. See the Test-Virtualization section for more information about how to use stubs.

More explanation about the syntax of the above can be found in the section describing all language elements. In the following sections, we will see examples on how to use the approaches introduced above.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*