Interface IZosBatchJob


public interface IZosBatchJob

Represents a zOS Batch Job.

Author:
Michael Baylis
  • Method Details

    • getJobname

      IZosBatchJobname getJobname()
      The IZosBatchJobname associated with this job
      Returns:
      batch job name
    • getJobId

      String getJobId()
      The jobid for this Job. Returns "????????" if no jobid has been associated
      Returns:
      batch jobid
    • getOwner

      String getOwner()
      The owner for this Job. Returns "????????" if no owner has been associated
      Returns:
      batch job owner
    • getType

      String getType()
      The type for this Job, i.e. JOB, STC or TSU. Returns "???" if no type has been associated
      Returns:
      batch job type
    • getStatus

      The batch job value
      Returns:
      batch job value
    • getStatusString

      String getStatusString()
      The batch job value as a String, e.g.
      INPUT, ACTIVE, OUTPUT etc.
      Returns "????????" if the job has not been submitted

      N.B. Values are implementation dependent

      Returns:
      batch job value
    • getRetcode

      String getRetcode()
      The batch job completion return code, e.g.
      CC 0000, CC 0020, JCL ERROR, ABEND S0C4/code> etc.
      Returns "????" if the job has not been submitted
      Returns:
    • waitForJob

      int waitForJob() throws ZosBatchException
      Wait for a job to complete. Return the highest return code for the job. The method will wait for the default resource wait time before timing out. Returns
      invalid @link
      Integer.MIN_VALUE
      if return code is non numeric. Use getRetcode() to get the String value
      Returns:
      highest CC
      Throws:
      ZosBatchException
    • waitForJob

      int waitForJob(long timeout) throws ZosBatchException
      Wait for a job to complete. Return the highest return code for the job. The method will wait for the default resource wait time before timing out. Returns
      invalid @link
      Integer.MIN_VALUE
      if return code is non numeric. Use getRetcode() to get the String value
      Parameters:
      timeout - in seconds
      Returns:
      highest CC
      Throws:
      ZosBatchException
    • listSpoolFiles

      IZosBatchJobOutput listSpoolFiles() throws ZosBatchException
      Provides a list of the batch job spool files as an IZosBatchJobOutput object without retrieving spool file content
      Returns:
      The job output
      Throws:
      ZosBatchException
    • retrieveOutput

      IZosBatchJobOutput retrieveOutput() throws ZosBatchException
      Retrieve the batch job output as an IZosBatchJobOutput object
      Returns:
      The job output
      Throws:
      ZosBatchException
    • retrieveOutputAsString

      String retrieveOutputAsString() throws ZosBatchException
      Retrieve the batch job output as an String object
      Returns:
      The job output
      Throws:
      ZosBatchException
    • getSpoolFile

      Convenience method to retrieve the content of a spool file from the batch job given the ddname.

      NOTE: Returns the first matching instance in the list. If the batch job has multiple steps, there may be multiple instances of the ddname.

      Parameters:
      ddname - of the spool file
      Returns:
      the content of the first found spool file with the specified ddname
      Throws:
      ZosBatchException
    • cancel

      void cancel() throws ZosBatchException
      Cancel the batch job
      Throws:
      ZosBatchException
    • purge

      void purge() throws ZosBatchException
      Cancel the batch job and purge output from the queue
      Throws:
      ZosBatchException
    • saveOutputToResultsArchive

      void saveOutputToResultsArchive(String rasPath) throws ZosBatchException
      Save the job output to the Results Archive Store
      Parameters:
      rasPath - path in Results Archive Store
      Throws:
      ZosBatchException
    • setShouldArchive

      void setShouldArchive(boolean shouldArchive)
      Set flag to control if the job output should be automatically stored to the test output. Defaults to true
    • shouldArchive

      boolean shouldArchive()
      Return flag that controls if the job output should be automatically stored to the test output
    • setShouldCleanup

      void setShouldCleanup(boolean shouldCleanup)
      Set flag to control if the job output should be automatically purged from zOS. Defaults to true
    • shouldCleanup

      boolean shouldCleanup()
      Return flag that controls if the job output should be automatically purged from zOS
    • saveSpoolFileToResultsArchive

      void saveSpoolFileToResultsArchive(IZosBatchJobOutputSpoolFile spoolFile, String rasPath) throws ZosBatchException
      Save the supplied spool file to the Results Archive Store
      Parameters:
      spoolFile - the spool file to save
      rasPath - path in Results Archive Store
      Throws:
      ZosBatchException