SBMJOB
and CALL
are both Control Language (CL) commands used to execute programs, but they work differently in terms of execution method, job processing, and system resource management.
The CALL
command executes a program immediately in the current job (interactive or batch).
Syntax :
CALL PGM(MYPGM) PARM('VALUE1' 'VALUE2')
* Runs synchronously – The program executes immediately and must finish before the next command runs.
* Uses the current job's resources – Runs in the same job as the calling program.
* Tied to the user's session – If the session ends, the program stops.
* Common in interactive jobs – Typically used for menu-driven applications.
The SBMJOB
command submits a job to run in batch mode, allowing it to execute separately from the current session.
Syntax :
SBMJOB CMD(CALL PGM(MYPGM)) JOB(MYBATCHJOB)
* Runs asynchronously – The job runs in the background while the user can continue working.
* Uses a batch subsystem – The submitted job runs in a separate batch job queue.
* Independent execution – Even if the user logs off, the job continues running.
* Good for long-running tasks – Ideal for reports, backups, mass data processing, etc.
Feature | CALL | SBMJOB |
---|---|---|
Execution Mode | Synchronous (waits to finish) | Asynchronous (runs in background) |
Job Type | Runs in the current interactive/batch job | Runs in a separate batch job |
User Interaction | Tied to user session | Runs independently |
Resource Usage | Uses current job’s resources | Uses a batch subsystem |
Best Used For | Immediate program execution | Background processing, long tasks |
Continues If User Logs Off? | No | Yes |
Scenario: A user wants to generate a large report.