public class JCLExec extends java.lang.Object implements IExecute2
JCLExec exec = new JCLExec() exec.confDir('/var/dbb_1.0.1/conf') def rc = exec.dataset('USER.JCL').member('SAMPLE').execute() println "Job '${exec.getSubmittedJobId()}' was submitted successfully with maxRC = ${exec.maxRC}" exec.getAllDDNames().each({ ddName -> println "DD Name: $ddName" def file = new File("/u/user/sample/${ddName}.output") exec.saveOutput(ddName, file, null) })
Constructor and Description |
---|
JCLExec() |
Modifier and Type | Method and Description |
---|---|
JCLExec |
confDir(java.lang.String confDir)
Set the configuration directory where jobOutput REXX script could be found
|
JCLExec |
dataset(java.lang.String dataset)
Set the data set contains the JCL to be submitted
|
int |
execute()
Submit a JCL and wait for the job has been submitted
|
int |
executeAndWaitFor(int timeout,
java.util.concurrent.TimeUnit unit)
Submit a JCL and wait for a certain time before return
|
JCLExec |
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
|
java.util.List<java.lang.String> |
getAllDDNames(boolean qualified)
Return all qualified output DD names of the submitted job.
|
java.lang.String |
getConfDir()
Returns the configuration directory where jobOutput REXX script could be found
|
java.lang.String |
getDataset()
Return the data set that contains 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
|
java.lang.String |
getMaxRC()
Return the Max RC 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 in form of <jobName>(<jobId>)
|
java.lang.String |
getSubmittedJobName()
Returns the name of the submitted job
|
java.lang.String |
getText()
Return the JCL to be submitted
|
java.lang.String |
getVolser()
Return the volume serial of the data set
|
JCLExec |
jclEncoding(java.lang.String jclEncoding)
Set the encoding of the JCL
|
JCLExec |
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 encoding)
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,
boolean removeASA)
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 encoding)
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 encoding,
boolean removeASA)
Save the output of a specific DD in a file on HFS
|
void |
saveOutput(java.lang.String ddName,
java.lang.String sourceEncoding,
java.io.File file,
java.lang.String targetEncoding,
boolean removeASA)
Save the output of a specific DD in a file on HFS
|
void |
setConfDir(java.lang.String confDir)
Set the configuration directory where jobOutput REXX script could be found
|
void |
setDataset(java.lang.String dataset)
Set the data set contains 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
|
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
|
JCLExec |
text(java.lang.String text)
Set the content of the JCL to be submitted
|
JCLExec |
volser(java.lang.String volser)
Specify the volume serial of the data set
|
public int executeAndWaitFor(int timeout, java.util.concurrent.TimeUnit unit) throws BuildException
executeAndWaitFor
in interface IExecute2
timeout
- the amount of time to waitunit
- the timeout unitBuildException
- if an error occurredpublic int execute() throws BuildException
execute
in interface IExecute
BuildException
- if an error occurredpublic java.lang.String getSubmittedJobId()
public java.lang.String getSubmittedJobName()
public java.lang.String getDataset()
public void setDataset(java.lang.String dataset)
dataset
- the data set contains the JCL to be submittedpublic JCLExec dataset(java.lang.String dataset)
dataset
- the data set contains 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 JCLExec 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 JCLExec 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 JCLExec 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 JCLpublic JCLExec jclEncoding(java.lang.String jclEncoding)
jclEncoding
- the encoding of the JCLpublic java.lang.String getConfDir()
public void setConfDir(java.lang.String confDir)
confDir
- the configuration directory where jobOutput REXX script could be foundpublic JCLExec confDir(java.lang.String confDir)
confDir
- the configuration directory where jobOutput REXX script could be foundpublic java.lang.String getMaxRC()
public java.util.List<java.lang.String> getAllDDNames() throws BuildException
BuildException
- if an error occurredpublic java.util.List<java.lang.String> getAllDDNames(boolean qualified) throws BuildException
saveOutput
.qualified
- whether or not to retrieve qualified DD namesBuildException
- if an error occurredpublic void saveOutput(java.io.File file) throws BuildException
file
- the target file to save the output toBuildException
- if an error occurredpublic void saveOutput(java.io.File file, java.lang.String encoding) throws BuildException
file
- the target file to save the output toencoding
- the encoding to be used to write the outputBuildException
- if an error occurredpublic void saveOutput(java.lang.String ddName, java.io.File file) throws BuildException
ddName
- the DD contains the output to be savedfile
- the target file to save the output toBuildException
- if an error occurredpublic void saveOutput(java.lang.String ddName, java.io.File file, java.lang.String encoding) throws BuildException
ddName
- the DD contains the output to be savedfile
- the target file to save the output toencoding
- the encoding to be used to write the outputBuildException
- if an error occurredpublic void saveOutput(java.lang.String ddName, java.io.File file, boolean removeASA) throws BuildException
ddName
- the DD contains the output to be savedfile
- the target file to save the output toremoveASA
- remove first character (ASA character) of each line of outputBuildException
- if an error occurredpublic void saveOutput(java.lang.String ddName, java.io.File file, java.lang.String encoding, boolean removeASA) throws BuildException
ddName
- the DD contains the output to be savedfile
- the target file to save the output toencoding
- the encoding to be used to write the outputremoveASA
- remove first character (ASA character) of each line of outputBuildException
- if an error occurredpublic void saveOutput(java.lang.String ddName, java.lang.String sourceEncoding, java.io.File file, java.lang.String targetEncoding, boolean removeASA) throws BuildException
ddName
- the DD contains the output to be savedsourceEncoding
- the encoding to be used to read the sourcefile
- the target file to save the output totargetEncoding
- the encoding to be used to write the outputremoveASA
- remove first character (ASA character) of each line of outputBuildException
- if an error occurredpublic java.lang.String getVolser()
public void setVolser(java.lang.String volser)
volser
- the volume serial of the data setpublic JCLExec volser(java.lang.String volser)
volser
- the volume serial of the data setcom.ibm.dbb.build.JCLExec
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.