QMF Z Client: Batch Jobs vs. Procedures with Logic - What's the Difference?
Introduction
In the world of IBM QMF Z Client, automation is key. Two features stand out when it comes to reducing manual effort:
- Batch Jobs
- Procedures with Logic (REXX scripting)
At first glance, they seem similar-both automate query execution and report generation. But in reality, they serve very different purposes. In this post, we'll compare the two, highlight their strengths, and help you decide when to use each.
What Are Batch Jobs?
A QMF Batch Job is a JCL-driven execution of QMF commands.
- Runs under TSO, ISPF, or native z/OS.
- Executes without user intervention.
- Ideal for scheduled workloads.
Example:
//QMFINVOK EXEC PGM=IKJEFT01,
// TIME=NOLIMIT,
// REGION=0M
//FQMPARM DD DSN=FQM.SFQMPARM,DISP=SHR
//SYSTSIN DD *
ISPSTART PGM(FQMQMF) +
PARM(/FQM MODE=BATCH OPTFILE=DD:OPTIONS) +
NEWAPPL(FQM)
/*
This setup runs QMF in background mode, usually scheduled by JES.
What Are Procedures with Logic?
A Procedure with Logic is a QMF procedure enhanced with REXX scripting.
- Runs inside QMF (interactive or batch).
- Uses ADDRESS QRW to call QMF commands.
- Supports conditionals, loops, variables, and error handling.
Example: Run report only on Mondays
/* REXX */
ADDRESS QRW
if date('W') = 'Monday' then
"RUN PROC WEEKLY_REPORT"
else
SAY "Today is not Monday. Skipping report."
Here, QMF commands run only if the condition is met.
Side-by-Side Comparison
Aspect
|
Batch Job
|
Procedure with Logic
|
Execution
|
Runs via JCL in background
|
Runs inside QMF with REXX
|
Flexibility
|
Fixed, predefined steps
|
Dynamic logic (IF, DO, LOOP)
|
Interaction
|
Non-interactive
|
Can prompt user (SAY, PULL)
|
Best For
|
Scheduled workloads (e.g., overnight jobs)
|
Interactive or conditional workflows
|
Error Handling
|
Job fails → check logs later
|
Inline handling (SIGNAL ON ERROR)
|
Integration
|
Limited to QMF commands
|
Can combine REXX + QMF + other programs
|
When to Use What?
- Use Batch Jobs when…
- You need to run large, scheduled workloads like end-of-day or weekly exports.
- You don't need interactive input.
- Use Procedures with Logic when…
- You need dynamic, conditional workflows.
- You want to build mini-applications inside QMF.
- You need user prompts or advanced error handling.
For maximum power, you can combine both: schedule a batch job that calls a procedure with logic. This way, you get the best of both worlds-automation at the job level and intelligence inside the workflow.
Conclusion
While both Batch Jobs and Procedures with Logic automate QMF tasks, they operate at different layers:
- Batch Jobs automate execution and scheduling.
- Procedures with Logic automate decision-making and workflow logic.
Together, they transform QMF Z Client into a powerful automation engine for data queries, reporting, and BI on z/OS.
------------------------------
Shashank Sonavane
------------------------------