Python API modules
jobs
zoautil_py.jobs.cancel(job_id, *args, **kwargs)
Description
- Cancel (or purge) a z/OS Job.
Returns
- Return code of z/OS action.
Return type
- int
Raises
- zoautil_py.exceptions.JobPurgeException – Job was unable to be purged from listing (or verification failed).
Parameters
- job_id (str) – The Job ID to target.
Other Parameters
-
purge
(bool) – Cancel and purge the job from listing. -
job_name
(str) – Job name to specify (needed for some systems). -
timeout
(int) – Purge will attempt to verify the job is properly removed. Timeout (seconds) for this action.
Notes
- Users can call
_submit
to receive a ZOAUResponse object.
zoautil_py.jobs.get(job_id: str)
Description
- Returns single Job object from Job ID.
Returns
- Job Object matching job_id.
Return type
- Job
Parameters
- job_id (str) – Specify a particular
job_id
to list.
zoautil_py.jobs.list_dds(job_id, *args, **kwargs)
Description
- List DDs for a z/OS Job.
Parameters
- job_id (str) – Job ID to pull DDs from.
Other Parameters
-
owner
(str) – ISFOWNER parameter (needed for some systems). -
prefix
(str) – ISFPREFIX parameter (needed for some systems). -
sysin
(bool) – When True, the list will include SYSIN DDs.
Returns
- list[Dict] - List of Data Definitions (DD) as dictionaries
- “stepname” (str)
- “dataset” (str)
- “format” (str)
- “length” (str)
- “recnum” (str)
- “dsid” (str)
- “procstep” (str, optional)
- None - Empty list if no DDs are present
Raises
- DDQueryException
- BGYSC3505E - If the job is not ready for DD querying yet.
- BGYSC3506E - If the job is at a transmission phase.
Notes
- Users can call
_list_dds
to receive a ZOAUResponse object.
zoautil_py.jobs.listing(job_id=None, job_owner=None, *args, **kwargs)
Description
- Lists jobs on the system.
Returns
- List of jobs obtained from listing (varies based on permissions, parameters).
Return type
- list[zoautil_py.types.Job]
Parameters
-
job_id (str) – Specify a particular job_id to list.
-
job_owner (str) – List of jobs by job_owner. Only honored when job_id is None.
Notes
- Users can call
_listing
to receive a ZOAUResponse object.
zoautil_py.jobs.read_output(job_id, stepname, dataset, *args, **kwargs)
Description
- Read output from a z/OS Job DD.
Returns
- Content contained in the Job DD.
Return type
- str
Parameters
-
job_id (str) – Job ID to pull DDs from.
-
stepname (str) – Stepname to specify.
-
dataset (str) – Dataset to read from.
Other Parameters
-
dsid
(str) – dataset id (if provided will overide stepname, dataset, procstep). -
owner
(str) – ISFOWNER parameter (needed for some systems). -
prefix
(str) – ISFPREFIX parameter (needed for some systems). -
procstep
(str) – For jobs with multiple steps per DD.
Notes
- Users can call
_read_output
to receive a ZOAUResponse object.
zoautil_py.jobs.submit(dataset, wait=True, *args, **kwargs)
Description
- Submit a z/OS JCL Job.
Returns
-
zoautil_py.types.Job – Job object representing the submitted dataset.
-
None – If wait is False.
Raises
- zoautil_py.exceptions.JobSubmitException – Job failed to submit.
Parameters
-
dataset (str) – The dataset or HFS file name to submit.
-
wait (bool) – z/OS jobs sometimes have a submission delay, wait for job to exist if True.
Other Parameters
-
timeout
(int) – Number of seconds to wait until timeout. -
hfs
(bool) – If the dataset (JCL source) is a HFS file.
Notes
- Users can call
_submit
to receive a ZOAUResponse object.