com.ibm.jzos.sample

Class MvsJobOutput

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


  • public class MvsJobOutput
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String JOB_OUTPUT_CMD 
      static java.lang.String JOB_STATUS_CMD 
    • Constructor Summary

      Constructors 
      Constructor and Description
      MvsJobOutput() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String getStatus(MvsJob job)
      Returns the job status using the TSO "status" command, which is invoked via the "jobStatus" REXX USS script.
      static void main(java.lang.String[] args)
      A sample main method that writes sysout output for a job to System.out (STDOUT).
      static void writeJobOutput(MvsJob mvsJob, java.io.Writer writer)
      Writes all of the output for a given job to a writer.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MvsJobOutput

        public MvsJobOutput()
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.io.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:
        java.io.IOException
      • getStatus

        public static java.lang.String getStatus(MvsJob job)
                                          throws java.io.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:
        java.io.IOException - if there was an error communicating with the child REXX script process
      • writeJobOutput

        public static void writeJobOutput(MvsJob mvsJob,
                          java.io.Writer writer)
                                   throws java.io.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:
        java.io.IOException
© Copyright IBM Corporation 2005, 2014.