z/OS concepts
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


Batch processing and JES: Scenario 2

z/OS concepts

Suppose that you want to make a backup of one master file and then update the master file with records read in from another file (the update file).

If so, you need a job with two steps:
  1. In Step 1, your job reads the master file and writes it to tape.
  2. In Step 2, another program (which can be written in COBOL) is executed to read a record from the update file and searches for its match in the master file. The program updates the existing record (if it finds a match) or adds a new record if needed.

In this scenario, what kind of functions are needed in the operating system to meet your requirements? Your JCL must have two steps, the first one indicating the resources for the backup program, and the second for the update program.

  • Who you are
  • What resources are needed by the job, such as the following:
    • Load the backup program (that you already have compiled).
    • How much memory the system needs to allocate to accommodate the backup program, I/O buffers, and working areas.
    • Make accessible to the backup program an output tape data set to receive the backup, a copy, and the master file data set itself.
    • At program end indicate to the operating system that now your update program needs to be loaded into memory (however, this should not be done if the backup program failed).
    • Make accessible to the update program the update file and master file.
    • Make accessible to your program a printer for eventual messages.

Figure 1 illustrates the resources needed for each step.

Figure 1. Scenario 2

Logically, the second step will not be executed if the first one fails for any reason. The second step will have a // DD SYSOUT statement to indicate the need for output spooling.

The jobs are allowed to start only when there are enough resources available. In this way, the system is made more efficient: JES manages jobs before and after running the program; the base control program manages jobs during processing.





Copyright IBM Corporation 1990, 2010