Batch Jobs

How To Submit A Batch Job From An Online Program Or Dialog

Print class 60 has been reserved for writing JCL to the JES internal reader. By writing the JCL to class 60, a batch job is submitted to the MVS system. The following ADS command may be used:
     WRITE PRINTER FROM workline LENGTH 80 CLASS 60.
     Where 'workline' is an 80-character JCL or data statement.

After all the JCL records have been written, use the same comma to write one additional record:

      /*EOF (followed by 75 spaces)

Batch Job Scheduling Considerations

Many variables must be considered when attempting to determine which batch jobs can run simultaneously without one causing the other to wait or abort. Some of these considerations are discussed below.

CV vs. Local Execution

  1. CV execution.

  2. Local execution.

    Ready Mode

    1. Shared retrieval.
      • Any jobstep that readies all areas in shared retrieval should run local mode, not under the CV. No locks or journaling are needed. Rarely, a broken-chain condition might seem to occur if an update job is running simultaneously and one of the update pages is still in the output buffer. Some steps of a single job may run locally while others run under the CV.

      • A local retrieval job can access areas regardless of what other jobs are updating or reading those areas. A CV retrieval job cannot access areas that have been varied offline to the CV however, it can access areas that have been varied retrieval-only.


    2. Shared update.
      • Any jobstep that updates an area usually readies the area in shared update mode. This allows other retrieval and shared-update jobs to access the area at the same time. Record deadlock can occur if two jobs lock two records in reverse order. Timeout abends can occur if one job has to wait too long to get to a record that has been locked by the other job. Frequent commits (after every 1000 records or so) can prevent the latter problem, but a "deadly embrace" deadlock is often unavoidable both jobs' paths must be nearly identical to avoid this situation from occurring.


    3. Protected update.
      • An area readied in protected update mode is inaccessible to any other run units that wish to ready the area in shared or protected update however, other retrieval run units may access the area simultaneously. Since the CV knows that only this job is updating the area, the CV doesn't have to maintain lock tables to keep track of which records are locked by whom therefore, the job will not run the risk of grabbing all the CV's storage. The job should run faster than it would in shared retrieval mode because the CV does not have to inspect any gigantic lock tables before each update.

      • Protected update mode is unsuitable for any batch job that might run during the day when the online system is active because the online user cannot update the area until the batch job finishes.



    table of contents prev page next page