Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
2.3.1 Specifying multiple steps in a JCL script One of the key strengths of a JCL script is its ability to control and manage multiple steps within a job and submit the job to the system for the execution. Depending on the availability of the system resources (such as CPU, memory, data set access) and the priority of the job, the operating system schedules the job. In this section, we use a simple scenario to describe the steps required to develop a multi-steps job and discuss the integration of legacy applications with a new Java application. Consider the following scenario: There is a legacy application that produces a summary of transactions of customer accounts which occurred in a particular business day (called the transaction summary). There is another legacy application that updates the interest rate associated with each account given a data set that lists the account IDs and corresponding interest rates (called interest rate adjustment). Both applications are implemented using REXX execs. The company would like to develop a new program that uses the output of the transaction summary application to identify customers who use the system frequently so that the company can offer incentives to those customers (that is, adjust to a better interest rate). In the first stage of this project, the new program should produce an output that is suitable for the interest rate adjustment program. The logistics for determining candidate customers for the promotion should be implemented in a new program. In this scenario, the company decided to implement the new program in Java and integrate it with the legacy applications. Data set I/O requirements for the legacy applications are specified in a JCL script and they are accessed in the legacy applications via corresponding symbolic names (no hard-coded data set names in the applications). For the transaction summary application, the results are written to a data set which is specified in the JCL. Similarly, the input for the interest rate adjustment program expects the input data set to be specified via DD cards in a JCL script 1 . Provided all data set I/O requirements are specified in the JCL script, it is desirable to specify the data set I/O requirements for the new Java program in the JCL script as well. So, we use the BPXBATSL utility program to run the new Java program. Example 2-8 shows a sample JCL script that integrates the legacy applications and the new Java application. The first step in the script (GENREC) invokes the transaction summary program called GENRCDS, which produces a summary of account transactions on a particular day. The output of the program is written to a data set called USER1.DATA(TRANRCDS), which is specified using the DD statement (OUTFILE). The second step of the script (JAVARUN) invokes the new Java application called ProcessTrans. Notice that the output of the first step 1 It is possible to allocate DD cards dynamically in TSO environment using ALLOCATE rather than specifying everything in a JCL script. However we prefer to set everything in a JCL script for a job for the manageability of the job. Chapter 2. Job management 23