Package com.ibm.dbb.build
Class MVSJob
- java.lang.Object
-
- com.ibm.dbb.build.MVSJob
-
public class MVSJob extends java.lang.Object
The MVSJob class is used to collect and free passed DD statements between MVSExec commands.
This class has two modes of operation:- Use the
addExecutable(IExecutable)
andexecute()
methods to load and execute a list of executable commands. - Use the
start()
andstop()
methods to wrap any set of arbitrary code statements that contain MVSExec commands
- See Also:
MVSExec
- Use the
-
-
Constructor Summary
Constructors Constructor Description MVSJob()
Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExecutable(IExecute executable)
Adds an executable (IExecutable
) to the list of executables to run.MVSJob
executable(IExecute executable)
Execute a commandint
execute()
Executes the list of commands that were added using theaddExecutable()
method, cleaning up any passed DD statements at the end of the run.java.util.List<IExecute>
getExecutables()
Return a list of commands to be executedint
getFailedStepNumber()
Retrieve the index of the commands failed to executeint
getMaxRC()
Retrieve the expected maximum return codeMVSJob
maxRC(int maxRC)
Set the maximum return code allowed during theexecute
methodvoid
setExecutables(java.util.List<IExecute> executables)
Sets the list of executables to runvoid
setMaxRC(int maxRC)
Set the maximum return code allowed during theexecute
methodvoid
start()
Starts collecting passed DD statements from MVSExec commands for freeing later.void
stop()
Stops collecting passed DD statements and frees all that has been collected.
-
-
-
Method Detail
-
start
public void start()
Starts collecting passed DD statements from MVSExec commands for freeing later.
-
stop
public void stop()
Stops collecting passed DD statements and frees all that has been collected.
-
execute
public int execute() throws BuildException
Executes the list of commands that were added using theaddExecutable()
method, cleaning up any passed DD statements at the end of the run. If any executable exceeds the max RC (if set) then further execution is halted and the RC of the last executable to run is returned. UsegetFailedStepNumber()
to identify which executable failed.- Returns:
- The RC of the last executable executed
- Throws:
BuildException
- an exception occurred
-
getExecutables
public java.util.List<IExecute> getExecutables()
Return a list of commands to be executed- Returns:
- the list of commands
-
setExecutables
public void setExecutables(java.util.List<IExecute> executables)
Sets the list of executables to run- Parameters:
executables
- The list of executables to run
-
addExecutable
public void addExecutable(IExecute executable)
Adds an executable (IExecutable
) to the list of executables to run.- Parameters:
executable
- The executable to run
-
getMaxRC
public int getMaxRC()
Retrieve the expected maximum return code- Returns:
- the expected maximum return code
-
getFailedStepNumber
public int getFailedStepNumber()
Retrieve the index of the commands failed to execute- Returns:
- the index of failed command
-
setMaxRC
public void setMaxRC(int maxRC)
Set the maximum return code allowed during theexecute
method- Parameters:
maxRC
- The maximum return code allowed
-
executable
public MVSJob executable(IExecute executable)
Execute a command- Parameters:
executable
- the command to be executed- Returns:
- this instance
-
maxRC
public MVSJob maxRC(int maxRC)
Set the maximum return code allowed during theexecute
method- Parameters:
maxRC
- The maximum return code allowed- Returns:
- this instance
-
-