Modernization Hub

EOJ - End of Job

Enhanced Definition

EOJ (End of Job) signifies the completion of all processing for a batch job submitted to the z/OS operating system. It marks the point where the Job Entry Subsystem (JES) begins its final cleanup and termination activities for that specific job, regardless of whether it completed successfully or abnormally. EOJ, or End of Job, signifies the completion of a batch job's execution within the z/OS operating system. It marks the point where the operating system recognizes that all steps within a JCL-defined job have finished processing, whether successfully or abnormally. This event triggers system cleanup, resource deallocation, and the finalization of job-related logging. EOJ, or End of Job, signifies the completion of a batch job within the z/OS operating system. It marks the point where all defined steps within a Job Control Language (JCL) job have finished execution, regardless of whether they completed successfully or with errors. Its primary purpose is to signal the operating system and job management subsystems that the job's processing is complete.

Key Characteristics

    • Triggered by Completion: EOJ is triggered when the last EXEC statement (job step) in the JCL has completed execution, or when the job is explicitly cancelled or abnormally terminated (abend).
    • Resource Release: During EOJ processing, all resources allocated to the job, such as datasets, memory, and devices, are released back to the system for reuse by other jobs.
    • Job Status Update: JES updates the job's status in its internal queues, records its final completion code (e.g., CC=0000 for successful completion, or an abend code like S0C7), and prepares the job log for output.
    • JES Spool Processing: JES handles the disposition of spool files (SYSOUT, SYSPRINT, etc.) generated by the job, based on the DD statements and OUTPUT statements in the JCL, routing them to printers, archives, or holding them.
    • SMF Record Generation: System Management Facilities (SMF) records are written at EOJ, capturing vital statistics about the job's execution, resource consumption, and completion status, used for accounting and performance analysis.

Use Cases

    • Normal Batch Job Completion: After a COBOL program processes a file and updates a DB2 database, EOJ signifies the successful completion of the entire batch process, allowing dependent jobs to proceed.
    • Abnormal Termination Handling: If a job encounters a program error (e.g., S0C7 data exception) or a system error (S322 time-out), EOJ processing still occurs to clean up resources, but the job's completion code will clearly indicate an abend.
    • Resource Cleanup and Management: Ensuring that temporary datasets are deleted (DISP=(NEW,DELETE)) and all allocated system resources are freed, preventing resource contention or exhaustion for subsequent jobs.
    • Auditing and Reporting: SMF records generated at EOJ are crucial for system administrators and accounting systems to track resource usage, job performance, and for chargeback purposes.

Related Concepts

EOJ is intrinsically linked to the JOB statement in JCL, which defines the entire unit of work. While individual STEPs have their own termination, EOJ encompasses the completion of all steps within a JOB. JES (JES2 or JES3) is responsible for managing the job's lifecycle, from submission to EOJ, including resource allocation and deallocation. The INITIATOR is the system component that executes the job's steps, and its role for a specific job effectively ends when EOJ is reached. SMF records are generated at EOJ to provide a comprehensive summary of the job's execution.

Best Practices:
  • Monitor Completion Codes: Always check the job's completion code (e.g., MAXCC, RC, or abend code) at EOJ to verify successful execution or identify issues promptly.
  • Proper Resource Disposition: Use appropriate DISP parameters in JCL (e.g., DISP=(NEW,CATLG,DELETE), DISP=(OLD,PASS)) to ensure datasets are managed correctly and temporary resources are cleaned up.
  • Conditional Execution: Employ COND parameters on EXEC statements to prevent subsequent steps from running if a prior step fails, ensuring controlled job flow even before the final EOJ is reached.
  • Error Handling within Programs: Implement robust error handling within COBOL or other application programs to gracefully manage expected issues, potentially setting return codes that can influence subsequent JCL steps before the final EOJ.
  • Review Job Logs: Regularly review the job log (SYSOUT) after EOJ

Related Vendors

Broadcom

235 products

IBM

646 products

Applied Software

7 products

Trax Softworks

3 products

Related Categories

Automation

222 products

Administration

395 products

Security

144 products

Operating System

154 products

Encryption

41 products

Files and Datasets

168 products