Class MvsJobSubmitter

java.lang.Object
com.ibm.jzos.MvsJobSubmitter

public class MvsJobSubmitter extends Object
Class to submit a job to the internal reader, returning the jobid. The internal reader is dynamically allocated according to the supplied parameters.

For more information on internal reader, refer to the Internal Reader Facility section in z/OS JES Application Programming, SA23-2240 and the Dynamic allocation chapter in z/OS V1R12.0 MVS Programming Authorized Assembler Service Guide.

Since:
2.4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
     
    static final boolean
     
    static final int
     
    static final int
    Maximum length allowed for a JCL symbol name
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct and open an internal reader using default parameters (recfm=fixed, lrecl=80, rdrclass='*').
    MvsJobSubmitter(int rdrLrecl, boolean rdrIsFixedRecfm, char rdrClass)
    Construct and open an internal reader using supplied parameters.
    MvsJobSubmitter(int rdrLrecl, boolean rdrIsFixedRecfm, char rdrClass, String subsystem, List<String> symbolNames)
    Construct and open an internal reader using JES symbols and supplied parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Flush and close the input to the internal reader, causing the job to be submitted.
    Return the job correlator for the submitted job.
    Return the jobid for the submitted job.
    char
    Return the SYSOUT class of the internal reader allocation.
    int
    Return the internal reader allocation's LRECL.
    boolean
    Return true of the internal reader has been allocated with a fixed RECFM, false otherwise.
    void
    write(byte[] bytes)
    Write the supplied byte array as a record to the allocated internal reader.
    void
    write(byte[] bytes, int offset, int length)
    Write the supplied byte array as a record to the allocated internal reader.
    void
    write(String line)
    Write the supplied string as a record to the allocated internal reader.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_RDR_LRECL

      public static final int DEFAULT_RDR_LRECL
      See Also:
    • DEFAULT_RDR_FIXED_RECFM

      public static final boolean DEFAULT_RDR_FIXED_RECFM
      See Also:
    • DEFAULT_RDR_CLASS

      public static final char DEFAULT_RDR_CLASS
      See Also:
    • MAX_JCL_SYMBOL_NAME_LEN

      public static final int MAX_JCL_SYMBOL_NAME_LEN
      Maximum length allowed for a JCL symbol name
      See Also:
  • Constructor Details

    • MvsJobSubmitter

      public MvsJobSubmitter() throws IOException
      Construct and open an internal reader using default parameters (recfm=fixed, lrecl=80, rdrclass='*').
      Throws:
      IOException - if unable to allocate or open the internal reader
    • MvsJobSubmitter

      public MvsJobSubmitter(int rdrLrecl, boolean rdrIsFixedRecfm, char rdrClass) throws IOException
      Construct and open an internal reader using supplied parameters.
      Parameters:
      rdrLrecl - the LRECL of the internal reader allocation.
      rdrIsFixedRecfm - if true, records are fixed length.
      rdrClass - the sysout class of the internal reader. If '*' is specified, then the default sysout class for the current job will be used. Note that is not the class of the submitted job, which is set on the jobcard or by installation defaults.
      Throws:
      IOException - if unable to allocate or open the internal reader
    • MvsJobSubmitter

      public MvsJobSubmitter(int rdrLrecl, boolean rdrIsFixedRecfm, char rdrClass, String subsystem, List<String> symbolNames) throws IOException
      Construct and open an internal reader using JES symbols and supplied parameters
      Parameters:
      rdrLrecl - the LRECL of the internal reader allocation.
      rdrIsFixedRecfm - if true, records are fixed length.
      rdrClass - the sysout class of the internal reader. If '*' is specified, then the default sysout class for the current job will be used. Note that is not the class of the submitted job, which is set on the jobcard or by installation defaults.
      subsystem - JES subsystem name (case-sentive). Default to the primary subsystem if null.
      symbolNames - a list of JES symbol names. JES symbols used for submitting a job must conform to JCL rules. If "*" is specified, all symbols available to the current task and conform to JCL limitations will be passed to the internal reader.
      Throws:
      RcException - if unable to allocate internal reader. RC containing S99Error in the high order 16 bits and S99Info in the low order 16 bits. To interpret error reason code, refer to the Dynamic allocation chapter in z/OS V1R12.0 MVS Programming Authorized Assembler Service Guide.
      IOException - if unable to open internal reader.
      IllegalArgumentException - if the length of a symbol name is invalid
      NullPointerException - if a symbol name is null
      Since:
      2.4.6
  • Method Details

    • getRdrClass

      public char getRdrClass()
      Return the SYSOUT class of the internal reader allocation. Note that this is not the class of the submitted job, which is set on the job card.
    • getRdrLrecl

      public int getRdrLrecl()
      Return the internal reader allocation's LRECL.
      Returns:
      rdlLrecl
    • isRdrFixedRecfm

      public boolean isRdrFixedRecfm()
      Return true of the internal reader has been allocated with a fixed RECFM, false otherwise.
    • write

      public void write(String line) throws IOException
      Write the supplied string as a record to the allocated internal reader.
      Parameters:
      line - job record
      Throws:
      IOException
    • write

      public void write(byte[] bytes) throws IOException
      Write the supplied byte array as a record to the allocated internal reader.
      Parameters:
      bytes - the byte array to be written
      Throws:
      IOException
      IllegalStateException - if the reader is not open
    • write

      public void write(byte[] bytes, int offset, int length) throws IOException
      Write the supplied byte array as a record to the allocated internal reader.
      Parameters:
      bytes - the byte array to be written
      offset - the offset from the beginning of the byte array
      length - the size to be written
      Throws:
      IOException
      IllegalStateException - if the reader is not open
    • close

      public void close() throws IOException
      Flush and close the input to the internal reader, causing the job to be submitted.
      Throws:
      IOException
      IllegalStateException - if the reader is not open
    • getJobid

      public String getJobid() throws IOException
      Return the jobid for the submitted job. This method should be called only after all calls to write(String) and/or write(byte[], int, int) are complete. It will issue a close() if necessary.
      Returns:
      the jobid
      Throws:
      IOException - if there is an error closing, or if a jobid was not created.
    • getJobCorrelator

      public String getJobCorrelator() throws IOException
      Return the job correlator for the submitted job. This method should be called only after all calls to write(String) and/or write(byte[], int, int) are complete. It will issue a close() if necessary.
      Returns:
      the job correlator for the submitted job
      Throws:
      IOException
      Since:
      2.4.6