Monday, 14 September 2026

How to Submit JCL with Zowe CLI and Check Job Output

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.

Zowe CLI submit JCL and inspect JES job output
Submit the JCL, capture the job ID, then inspect its JES status and spool output.

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.

Working rule: treat the job ID as the start of the check. The result is complete only after you examine status, step codes, spool messages, and application output.

Preflight checks before submitting JCL

CheckWhy it mattersWhat to confirm
Zowe profileThe CLI must reach the intended LPAR.Host, port, base profile, TLS settings, and the selected z/OSMF connection are correct.
Jobs REST accessz/OSMF mediates submission and spool retrieval.Your user ID can submit jobs and read the resulting job and spool resources.
JCL sourceThe submit subcommand depends on where the JCL is stored.Use a data-set member, local file, USS file, or standard input deliberately.
JOB statementClass and message settings affect routing and output.The expected job class, MSGCLASS, notification, and hold rules are present.
Change controlsA 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.

Do not read “OUTPUT” as “passed.” It means JES has output available. A job can reach OUTPUT with 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:

StatusMeaningNext check
INPUTJES has the job in an input queue.Check job class, hold state, conversion messages, and initiator availability.
ACTIVEThe job is executing or is active in JES processing.Wait according to the site procedure; do not submit a duplicate run.
OUTPUTJES output is available.Inspect return codes and the required spool DDs.
Not found or purgedThe 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
Faster diagnosis: start with 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

  1. Confirm that the job ID belongs to the expected environment and submission.
  2. Check whether the job is INPUT, ACTIVE, or OUTPUT.
  3. List the spool files and locate JESYSMSG.
  4. Find the first step with a nonzero condition code, JCL ERROR, or abend.
  5. Open the diagnostic DD for that step.
  6. Compare record counts, control totals, reports, or downstream state with the test expectation.
  7. 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.

Official Zowe references

No comments:

Post a Comment

New In-feed ads