Class MvsJobSubmitter
java.lang.Object
com.ibm.jzos.MvsJobSubmitter
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
FieldsModifier and TypeFieldDescriptionstatic final charstatic final booleanstatic final intstatic final intMaximum length allowed for a JCL symbol name -
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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 TypeMethodDescriptionvoidclose()Flush and close the input to the internal reader, causing the job to be submitted.Return the job correlator for the submitted job.getJobid()Return the jobid for the submitted job.charReturn the SYSOUT class of the internal reader allocation.intReturn the internal reader allocation's LRECL.booleanReturn true of the internal reader has been allocated with a fixed RECFM, false otherwise.voidwrite(byte[] bytes) Write the supplied byte array as a record to the allocated internal reader.voidwrite(byte[] bytes, int offset, int length) Write the supplied byte array as a record to the allocated internal reader.voidWrite the supplied string as a record to the allocated internal reader.
-
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_LENMaximum length allowed for a JCL symbol name- See Also:
-
-
Constructor Details
-
MvsJobSubmitter
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
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 inz/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 invalidNullPointerException- 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
Write the supplied string as a record to the allocated internal reader.- Parameters:
line- job record- Throws:
IOException
-
write
Write the supplied byte array as a record to the allocated internal reader.- Parameters:
bytes- the byte array to be written- Throws:
IOExceptionIllegalStateException- if the reader is not open
-
write
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:
IOExceptionIllegalStateException- if the reader is not open
-
close
Flush and close the input to the internal reader, causing the job to be submitted.- Throws:
IOExceptionIllegalStateException- if the reader is not open
-
getJobid
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:
IOException- if there is an error closing, or if a jobid was not created.
-
getJobCorrelator
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:
IOException- Since:
- 2.4.6
-