JOB12345 has been submitted, but it remains in INPUT. That result confirms only that z/OSMF returned a job identifier. To decide whether the run passed, use Zowe CLI to check the JES status, list the spool files, read the relevant DD output, and then inspect the return code and business result.
Last updated: September 14, 2026
What Zowe CLI proves after submission
The zowe zos-jobs submit command sends JCL through the configured z/OSMF Jobs REST service. When the service returns a job name and job ID, the submission request has been accepted for processing. It does not prove that the job ran, that every step ended within the permitted return-code range, or that the application produced the expected records.
Preflight checks before submitting JCL
| Check | Why it matters | What to confirm |
|---|---|---|
| Zowe profile | The CLI must reach the intended LPAR. | Host, port, base profile, TLS settings, and the selected z/OSMF connection are correct. |
| Jobs REST access | z/OSMF mediates submission and spool retrieval. | Your user ID can submit jobs and read the resulting job and spool resources. |
| JCL source | The submit subcommand depends on where the JCL is stored. | Use a data-set member, local file, USS file, or standard input deliberately. |
| JOB statement | Class and message settings affect routing and output. | The expected job class, MSGCLASS, notification, and hold rules are present. |
| Change controls | A CLI command can start real batch processing. | The target environment, identity, scheduler rules, and rerun authority match the approved procedure. |
For JOB-card details, including CLASS, MSGCLASS, MSGLEVEL, and NOTIFY, see the JCL JOB card guide.
Submit a PDS or PDSE member
This example submits member DAILY from USER01.JCL. Single quotes work in PowerShell and POSIX-style shells because they prevent the parentheses from being interpreted locally.
zowe zos-jobs submit data-set 'USER01.JCL(DAILY)' --wait-for-output
--wait-for-output keeps the command open until the job reaches OUTPUT or the request times out. Record the returned job name and job ID; later status and spool commands need that identifier.
CC 0008, JCL ERROR, or an abend.Submit JCL from a local file
A local file is useful for a controlled developer test when the file is already reviewed and stored under the team’s source-control rules.
zowe zos-jobs submit local-file ./daily-test.jcl --wait-for-output
Check record length, continuation columns, symbols, and character conversion before sending editor-created JCL. Run an unproven file in an approved non-production class first.
Check the job status by job ID
zowe zos-jobs view job-status-by-jobid JOB12345
The status tells you where the job is in JES processing:
| Status | Meaning | Next check |
|---|---|---|
INPUT | JES has the job in an input queue. | Check job class, hold state, conversion messages, and initiator availability. |
ACTIVE | The job is executing or is active in JES processing. | Wait according to the site procedure; do not submit a duplicate run. |
OUTPUT | JES output is available. | Inspect return codes and the required spool DDs. |
| Not found or purged | The ID is wrong, access is restricted, or JES retention has expired. | Confirm the exact job ID, target system, owner, and retention policy. |
List and read the spool files
Use list to obtain the spool-file IDs. The earlier view spool-files-by-jobid form is not a valid Zowe CLI command.
zowe zos-jobs list spool-files-by-jobid JOB12345
The response identifies DD names such as JESMSGLG, JESJCL, JESYSMSG, SYSPRINT, and application-specific output. After finding the numeric spool ID, read that item:
zowe zos-jobs view spool-file-by-id JOB12345 4
When you need one combined stream for a small diagnostic job, request all spool content:
zowe zos-jobs view all-spool-content JOB12345
JESYSMSG for allocation, JCL, and step-completion messages. Then open the program’s diagnostic DD, often SYSPRINT or SYSOUT.Read the result in the correct order
- Confirm that the job ID belongs to the expected environment and submission.
- Check whether the job is
INPUT,ACTIVE, orOUTPUT. - List the spool files and locate
JESYSMSG. - Find the first step with a nonzero condition code,
JCL ERROR, or abend. - Open the diagnostic DD for that step.
- Compare record counts, control totals, reports, or downstream state with the test expectation.
- Keep the job ID, return codes, and evidence with the change record.
Example interpretation of a returned status
A typical response supplies a job name, job ID, owner, status, and return-code field. Field names and display formatting can vary with the CLI version and response-format options, but the decision remains the same.
jobname: DAILY
jobid: JOB12345
status: OUTPUT
retcode: CC 0008
This job reached OUTPUT, but it did not meet a zero-return-code rule. Read JESYSMSG to identify the failing step and then open that step’s compiler, utility, or application output.
Why RC=0008 requires investigation
Suppose a compile step returns CC 0008. Read the compiler listing before resubmitting. Causes can include a missing COPY library, an invalid compiler option, a source member that was not promoted, or a DB2 precompile and bind mismatch. If nothing changed, another submission only creates a second job with the same defect.
Return-code handling depends on the program and the job’s control rules. The JCL COND parameter examples explain how subsequent steps can be bypassed after earlier return codes.
Common Zowe job-submission failures
Data set or member not found
Confirm the high-level qualifier, data-set name, and member spelling. A sequential data set has no member suffix. If the data set is uncataloged, obtain the correct volume and site procedure instead of guessing.
The job never leaves INPUT
Check the JOB statement class, hold state, conversion messages, and initiator availability. INPUT describes a JES queue state; it is not an application return code.
Authentication, authorization, or connection failure
Verify the selected profile and target system. The z/OSMF server must be reachable, and the user ID must have the required Jobs REST and JES resource access. Do not place passwords, tokens, or certificate material in shell history, JCL, or support tickets.
OUTPUT status with the wrong business result
A zero return code can still accompany incorrect business output when the program’s validation is incomplete. Check the required record count, control total, report fields, database updates, or generated data set—not only the JES status.
Use machine-readable output in scripts
Zowe CLI response-format options can return a single field for a script. For example, capture the submitted job ID rather than scraping a formatted table:
zowe zos-jobs submit data-set 'USER01.JCL(DAILY)' \
--wait-for-output \
--response-format-filter jobid \
--response-format-type string
Test response-field names against the Zowe CLI version installed in your environment. A script should also handle timeouts, missing spool data, nonzero condition codes, abends, and duplicate-submission protection.
Keep automation inside the approved boundary
Zowe CLI can make development and test submission repeatable. Continue to use the site’s scheduler, production identity, change process, and rerun controls for production jobs. A personal CLI profile should not become an unreviewed production scheduler.
Related reading: JCL vs Scripts on Mainframes and ISPF vs Zowe vs Topaz.
Frequently asked questions
Can Zowe CLI submit JCL from USS?
Yes. The zos-jobs submit command group includes data-set, local-file, USS-file, and standard-input forms. Choose the source that follows the team’s review and source-control procedure.
Does --wait-for-output prove that the job passed?
No. It waits for the job to reach OUTPUT. You must still inspect step return codes, abends, relevant spool DDs, and the application-level result.
How do I list spool files with Zowe CLI?
Run zowe zos-jobs list spool-files-by-jobid JOB12345. Then pass the returned spool ID to zowe zos-jobs view spool-file-by-id JOB12345 4.
Should I automate production reruns with Zowe CLI?
Only when the approved scheduler and change controls explicitly permit it. A production rerun can repeat financial, settlement, reporting, or downstream interface work.
No comments:
Post a Comment