JES utilities functionality overview
Submit a job
With ZOAU, you can submit a data set that contains JCL, for example ${prefix}.SAMPLE.JCL(JCL)
, in the following ways:
- Issuing a shell command:
job_id=`jsub "${prefix}.SAMPLE.JCL(JCL)"`
- Calling an API in Python programs:
jcl_dataset="%s.SAMPLE.JCL(JCL)" % datasets.get_hlq()
job_id = jobs.submit(jcl_dataset)
Submit a job from stdin
With ZOAU, you can submit a job from stdin
in the following way:
- Issuing a shell command:
export SOME_JCL="//LISTCAT JOB
//*
//DSEXIST EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES('@@HLQ@@.ZOASAMP.MY.JCL')
/*"
echo "$SOME_JCL" | jsub
Submit a job from a z/OS UNIX file
With ZOAU, you can submit a job from a UNIX System Services file in the following ways:
- Issuing a shell command:
jsub -f /path/to/somefile.jcl
- Calling an API in Python programs:
jcl_file="/path/to/somefile.jcl"
job_id = jobs.submit(jcl_file, is_unix=True)
Cancel a job
With ZOAU, you can cancel and purge a job in the following ways:
- Issuing a shell command:
In the following example, '*'
is used because we don't know the job name.
jcan C '*' $job_id
- Calling an API in Python programs:
jobs.cancel(job_id)
List jobs
With ZOAU, you can list jobs that match a pattern in the following ways:
- Issuing a shell command:
jls
- Calling an API in Python programs:
print(jobs.fetch_multiple())
List job DDs
With ZOAU, you can list ddnames for a given job in the following ways:
- Issuing a shell command:
ddls $job_id
- Calling an API in Python programs:
print(jobs.list_dds(job_id))
List job output for step name
With ZOAU, you can list the output for a given job id and ddname, for example JESJCL
with step name JES2
, in the following ways:
- Issuing a shell command:
pjdd $job_id JES2 JESJCL
- Calling an API in Python programs:
print(jobs.read_output(job_id, "JES2", "JESJCL"))
Print a job step with its dataset_id (DSID)
With ZOAU, you can print a job step with its dataset_id (DSID) in the following ways:
- Issuing a shell command:
pjdd $job_id 3
- Calling an API in Python programs:
print(jobs.read_output(job_id, dataset_id=3))