Package com.ibm.dbb.build
Class MVSJob
- java.lang.Object
-
- com.ibm.dbb.build.MVSJob
-
public class MVSJob extends java.lang.ObjectThe 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 voidaddExecutable(IExecute executable)Adds an executable (IExecutable) to the list of executables to run.MVSJobexecutable(IExecute executable)Execute a commandintexecute()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 executedintgetFailedStepNumber()Retrieve the index of the commands failed to executeintgetMaxRC()Retrieve the expected maximum return codeMVSJobmaxRC(int maxRC)Set the maximum return code allowed during theexecutemethodvoidsetExecutables(java.util.List<IExecute> executables)Sets the list of executables to runvoidsetMaxRC(int maxRC)Set the maximum return code allowed during theexecutemethodvoidstart()Starts collecting passed DD statements from MVSExec commands for freeing later.voidstop()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 BuildExceptionExecutes 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 theexecutemethod- 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 theexecutemethod- Parameters:
maxRC- The maximum return code allowed- Returns:
- this instance
-
-