com.ibm.jzos
Class MvsJobSubmitter
- java.lang.Object
-
- com.ibm.jzos.MvsJobSubmitter
-
public class MvsJobSubmitter extends java.lang.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 inz/OS V1R12.0 MVS Programming Authorized Assembler Service Guide
.- Since:
- 2.4.0
-
-
Field Summary
Fields Modifier and Type Field and Description static char
DEFAULT_RDR_CLASS
static boolean
DEFAULT_RDR_FIXED_RECFM
static int
DEFAULT_RDR_LRECL
static int
MAX_JCL_SYMBOL_NAME_LEN
Maximum length allowed for a JCL symbol name
-
Constructor Summary
Constructors Constructor and Description MvsJobSubmitter()
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, java.lang.String subsystem, java.util.List<java.lang.String> symbolNames)
Construct and open an internal reader using JES symbols and supplied parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
Flush and close the input to the internal reader, causing the job to be submitted.java.lang.String
getJobCorrelator()
Return the job correlator for the submitted job.java.lang.String
getJobid()
Return the jobid for the submitted job.char
getRdrClass()
Return the SYSOUT class of the internal reader allocation.int
getRdrLrecl()
Return the internal reader allocation's LRECL.boolean
isRdrFixedRecfm()
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(java.lang.String line)
Write the supplied string as a record to the allocated internal reader.
-
-
-
Field Detail
-
DEFAULT_RDR_LRECL
public static final int DEFAULT_RDR_LRECL
- See Also:
- Constant Field Values
-
DEFAULT_RDR_FIXED_RECFM
public static final boolean DEFAULT_RDR_FIXED_RECFM
- See Also:
- Constant Field Values
-
DEFAULT_RDR_CLASS
public static final char DEFAULT_RDR_CLASS
- See Also:
- Constant Field Values
-
MAX_JCL_SYMBOL_NAME_LEN
public static final int MAX_JCL_SYMBOL_NAME_LEN
Maximum length allowed for a JCL symbol name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MvsJobSubmitter
public MvsJobSubmitter() throws java.io.IOException
Construct and open an internal reader using default parameters (recfm=fixed, lrecl=80, rdrclass='*').- Throws:
java.io.IOException
- if unable to allocate or open the internal reader
-
MvsJobSubmitter
public MvsJobSubmitter(int rdrLrecl, boolean rdrIsFixedRecfm, char rdrClass) throws java.io.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:
java.io.IOException
- if unable to allocate or open the internal reader
-
MvsJobSubmitter
public MvsJobSubmitter(int rdrLrecl, boolean rdrIsFixedRecfm, char rdrClass, java.lang.String subsystem, java.util.List<java.lang.String> symbolNames) throws java.io.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 inz/OS V1R12.0 MVS Programming Authorized Assembler Service Guide
.java.io.IOException
- if unable to open internal reader.java.lang.IllegalArgumentException
- if the length of a symbol name is invalidjava.lang.NullPointerException
- if a symbol name is null- Since:
- 2.4.6
-
-
Method Detail
-
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(java.lang.String line) throws java.io.IOException
Write the supplied string as a record to the allocated internal reader.- Parameters:
line
- job record- Throws:
java.io.IOException
-
write
public void write(byte[] bytes) throws java.io.IOException
Write the supplied byte array as a record to the allocated internal reader.- Parameters:
bytes
- the byte array to be written- Throws:
java.io.IOException
java.lang.IllegalStateException
- if the reader is not open
-
write
public void write(byte[] bytes, int offset, int length) throws java.io.IOException
Write the supplied byte array as a record to the allocated internal reader.- Parameters:
bytes
- the byte array to be writtenoffset
- the offset from the beginning of the byte arraylength
- the size to be written- Throws:
java.io.IOException
java.lang.IllegalStateException
- if the reader is not open
-
close
public void close() throws java.io.IOException
Flush and close the input to the internal reader, causing the job to be submitted.- Throws:
java.io.IOException
java.lang.IllegalStateException
- if the reader is not open
-
getJobid
public java.lang.String getJobid() throws java.io.IOException
Return the jobid for the submitted job. This method should be called only after all calls towrite(String)
and/orwrite(byte[], int, int)
are complete. It will issue aclose()
if necessary.- Returns:
- the jobid
- Throws:
java.io.IOException
- if there is an error closing, or if a jobid was not created.
-
getJobCorrelator
public java.lang.String getJobCorrelator() throws java.io.IOException
Return the job correlator for the submitted job. This method should be called only after all calls towrite(String)
and/orwrite(byte[], int, int)
are complete. It will issue aclose()
if necessary.- Returns:
- the job correlator for the submitted job
- Throws:
java.io.IOException
- Since:
- 2.4.6
-
-