public class JobExec extends java.lang.Object implements IExecute
def jobExec = new JobExec().dataset("USR1.JCL").member("TEST")
def rc = jobExec.execute()
def jobID = jobExec.getSubmittedJobId()
def jobName = jobExec.getSubmittedJobName()
def listDDNames = jobExec.getAllDDNames(true)
jobExec.saveOutput(new File("/u/usr1/jcl/output.txt"))
Constructor and Description |
---|
JobExec() |
Modifier and Type | Method and Description |
---|---|
JobExec |
dataset(java.lang.String dataset)
Set the data set containing the JCL to be submitted
|
int |
execute()
Submit a JCL job and wait for the job to complete with default wait time of 1 hour
|
int |
execute(int timeout,
java.util.concurrent.TimeUnit timeUnit)
Submit a JCL job and wait for the job to complete within a designated time
|
JobExec |
file(java.io.File file)
Set the file on the HFS that contains the JCL to be submitted
|
java.util.List<java.lang.String> |
getAllDDNames()
Return all output DD names of the submitted job (qualified: false)
|
java.util.List<java.lang.String> |
getAllDDNames(boolean qualified)
Return all qualified output DD names of the submitted job.
|
java.lang.String |
getDataset()
Return the data set containing the JCL to be submitted
|
java.io.File |
getFile()
Return the file on the HFS that contains the JCL to be submitted
|
java.lang.String |
getJclEncoding()
Return the encoding of the JCL using standard charset name
|
java.lang.String |
getMaxRC()
Return the Maximum Return Code of the submitted job
|
java.lang.String |
getMember()
Return the member in a data set that contains the JCL to be submitted
|
java.lang.String |
getSubmittedJobId()
Returns the ID of the submitted job
|
java.lang.String |
getSubmittedJobIdAsRexx()
Returns the Name and ID of the submitted job in form of <jobName>(<jobId>)
|
java.lang.String |
getSubmittedJobName()
Returns the name of the submitted job
|
java.lang.String |
getText()
Return the JCL text to be submitted
|
java.lang.String |
getVolser()
Return the volume serial of the data set
|
JobExec |
jclEncoding(java.lang.String jclEncoding)
Set the encoding of the JCL using standard charset name
|
JobExec |
member(java.lang.String member)
Set the member in a data set that contains the JCL to be submitted
|
void |
saveOutput(java.io.File file)
Save the output of the submitted job in a file on HFS
|
void |
saveOutput(java.io.File file,
java.lang.String targetEncoding)
Save the output of the submitted job in a file on HFS
|
void |
saveOutput(java.lang.String ddName,
java.io.File file)
Save the output of a specific DD in a file on HFS
|
void |
saveOutput(java.lang.String ddName,
java.io.File file,
java.lang.String targetEncoding)
Save the output of a specific DD in a file on HFS
|
void |
saveOutput(java.lang.String ddName,
java.io.File file,
java.lang.String sourceEncoding,
java.lang.String targetEncoding)
Save the output of a specific DD in a file on HFS
|
void |
setDataset(java.lang.String dataset)
Set the data set containing the JCL to be submitted
|
void |
setFile(java.io.File file)
Set the file on the HFS that contains the JCL to be submitted
|
void |
setJclEncoding(java.lang.String jclEncoding)
Set the encoding of the JCL using standard charset name
|
void |
setMember(java.lang.String member)
Set the member in a data set that contains the JCL to be submitted
|
void |
setText(java.lang.String text)
Set the content of the JCL to be submitted
|
void |
setVolser(java.lang.String volser)
Specify the volume serial of the data set
|
JobExec |
text(java.lang.String text)
Set the content of the JCL to be submitted
|
JobExec |
volser(java.lang.String volser)
Specify the volume serial of the data set
|
public int execute() throws BuildException
execute
in interface IExecute
BuildException
- if an error occurredpublic int execute(int timeout, java.util.concurrent.TimeUnit timeUnit) throws BuildException
timeout
- the amount of time to waittimeUnit
- the unit of timeBuildException
- if an error occurredpublic java.lang.String getSubmittedJobIdAsRexx()
public java.lang.String getSubmittedJobId()
public java.lang.String getSubmittedJobName()
public java.util.List<java.lang.String> getAllDDNames()
public java.util.List<java.lang.String> getAllDDNames(boolean qualified)
saveOutput
.qualified
- retrieve qualified DD names if truepublic void saveOutput(java.io.File file) throws BuildException
file
- the target file to save the output toBuildException
- If DDName cannot be parsed or if codepages provided are invalidpublic void saveOutput(java.io.File file, java.lang.String targetEncoding) throws BuildException
file
- the target file to save the output totargetEncoding
- the iconv encoding to be used to write the outputBuildException
- If DDName cannot be parsed or if codepages provided are invalidpublic void saveOutput(java.lang.String ddName, java.io.File file) throws BuildException
ddName
- the DD containing the output to be saved. Can be qualified in the form DD:STEP:PROC and use splat (*) to retrieve all (e.g. JESYSMSG:JES2:, SYSTSPRT:DMHENU:GENMSG, SYSPRINT::)file
- the target file to save the output toBuildException
- If DDName cannot be parsed or if codepages provided are invalidpublic void saveOutput(java.lang.String ddName, java.io.File file, java.lang.String targetEncoding) throws BuildException
ddName
- the DD containing the output to be saved. Can be qualified in the form DD:STEP:PROC and use splat (*) to retrieve all (e.g. JESYSMSG:JES2:, SYSTSPRT:DMHENU:GENMSG, SYSPRINT::)file
- the target file to save the output totargetEncoding
- the iconv encoding to be used to write the outputBuildException
- If DDName cannot be parsed or if codepages provided are invalidpublic void saveOutput(java.lang.String ddName, java.io.File file, java.lang.String sourceEncoding, java.lang.String targetEncoding) throws BuildException
ddName
- the DD containing the output to be saved. Can be qualified in the form DD:STEP:PROC and use splat (*) to retrieve all (e.g. JESYSMSG:JES2:, SYSTSPRT:DMHENU:GENMSG, SYSPRINT::)file
- the target file to save the output tosourceEncoding
- the iconv encoding of the source outputtargetEncoding
- the iconv encoding to be used to write the outputBuildException
- If DDName cannot be parsed or if codepages provided are invalidpublic java.lang.String getDataset()
public void setDataset(java.lang.String dataset)
dataset
- the data set containing the JCL to be submittedpublic JobExec dataset(java.lang.String dataset)
dataset
- the data set containing the JCL to be submittedpublic java.lang.String getMember()
public void setMember(java.lang.String member)
member
- the member in a data set that contains the JCL to be submittedpublic JobExec member(java.lang.String member)
member
- the member in a data set that contains the JCL to be submittedpublic java.io.File getFile()
public void setFile(java.io.File file)
file
- the file on the HFS that contains the JCL to be submittedpublic JobExec file(java.io.File file)
file
- the file on the HFS that contains the JCL to be submittedpublic java.lang.String getText()
public void setText(java.lang.String text)
text
- the content of the JCL to be submittedpublic JobExec text(java.lang.String text)
text
- the content of the JCL to be submittedpublic java.lang.String getJclEncoding()
public void setJclEncoding(java.lang.String jclEncoding)
jclEncoding
- the encoding of the JCL using standard charset namepublic JobExec jclEncoding(java.lang.String jclEncoding)
jclEncoding
- the encoding of the JCL using standard charset namepublic java.lang.String getMaxRC()
public java.lang.String getVolser()
public void setVolser(java.lang.String volser)
volser
- the volume serial of the data setpublic JobExec volser(java.lang.String volser)
volser
- the volume serial of the data set<IBM Copyright © 2018 IBM Corp. All Rights Reserved.