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:
    1. Use the addExecutable(IExecutable) and execute() methods to load and execute a list of executable commands.
    2. Use the start() and stop() methods to wrap any set of arbitrary code statements that contain MVSExec commands
    See Also:
    MVSExec
    • Constructor Summary

      Constructors 
      Constructor and Description
      MVSJob()
      Default Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addExecutable(IExecute executable)
      Adds an executable (IExecutable) to the list of executables to run.
      MVSJob executable(IExecute executable)
      Execute a command
      int execute()
      Executes the list of commands that were added using the addExecutable() 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 executed
      int getFailedStepNumber()
      Retrieve the index of the commands failed to execute
      int getMaxRC()
      Retrieve the expected maximum return code
      MVSJob maxRC(int maxRC)
      Set the maximum return code allowed during the execute method
      void setExecutables(java.util.List<IExecute> executables)
      Sets the list of executables to run
      void setMaxRC(int maxRC)
      Set the maximum return code allowed during the execute method
      void 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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MVSJob

        public MVSJob()
        Default Constructor
    • 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 the addExecutable() 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. Use getFailedStepNumber() 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 the execute 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 the execute method
        Parameters:
        maxRC - The maximum return code allowed
        Returns:
        this instance

<IBM Copyright © 2018 IBM Corp. All Rights Reserved.