Class MvsJobOutput

java.lang.Object
com.ibm.jzos.sample.MvsJobOutput

public class MvsJobOutput extends Object
Sample program which reads all sysout data for a MvsJob (jobname and jobid), and writes the output to a specified Writer. The class relies on the sample REXX script "jobOutput", spawned as a child process via the Exec class.
Since:
2.1.0
  • Field Details

  • Constructor Details

    • MvsJobOutput

      public MvsJobOutput()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      A sample main method that writes sysout output for a job to System.out (STDOUT). The first argument is the jobname, and the second argument is the jobid (JOBnnnnn).
      Throws:
      IOException
    • getStatus

      public static String getStatus(MvsJob job) throws IOException
      Returns the job status using the TSO "status" command, which is invoked via the "jobStatus" REXX USS script.
      Returns:
      String the TSO "STATUS" command status
      Throws:
      IOException - if there was an error communicating with the child REXX script process
    • writeJobOutput

      public static void writeJobOutput(MvsJob mvsJob, Writer writer) throws IOException
      Writes all of the output for a given job to a writer. Note: this method flushes the writer, but does not close it. It is the caller's responsibility to close the writer.
      Throws:
      IOException