com.ibm.dbb.build

Class MVSExec

  • All Implemented Interfaces:
    IExecute


    public class MVSExec
    extends AbstractExec
    The MVSExec command is used to execute a program on System z.

    Usage:

     MVSExec mvsExec = new mvsExec();
     mvsExec.setPgm("DFSUNUB0");
     mvsExec.setParm("TEST");
     mvsExec.addDDStatment("UTPRINT", null, "tracks space(5,5) unit(vio) new", false);
     mvsExec.addDDStatment("FORMAT", HLQ + ".TFORMAT", "shr", false);
     mvsExec.addDDStatment("TASKLIB", "JAZZ00.IMS11.SDFSRESL", "shr", false);
     
     CopyToHFS copyToHFS = new CopyToHFS();
     copyToHFS.setDdName("UTPRINT");
     copyToHFS.setFile(new File(WORK_DIR + "/logs/" + MEMBER + ".log"));
     
     mvsExec.addCopyToHFS(copyToHFS);
     int rc = mvsExec.execute();
     
    • Constructor Summary

      Constructors 
      Constructor and Description
      MVSExec()
      Default Constructor
    • Constructor Detail

      • MVSExec

        public MVSExec()
        Default Constructor
    • Method Detail

      • addCopyToHFS

        public void addCopyToHFS(CopyToHFS copy)
        Adds a CopyToHFS command that will be executed after the program is executed but before the DD statements are freed.

        Useful for copying/storing compile log files from temporary PDS to HFS files.

        Parameters:
        copy - CopyToHFS command
      • setPgm

        public void setPgm(java.lang.String pgm)
        Set the name of MVS module to execute
        Parameters:
        pgm - the name of the MVS module
      • setParm

        public void setParm(java.lang.String parm)
        Set the parameters to be passed to the MVS module
        Parameters:
        parm - the parameters
      • setDdnames

        public void setDdnames(java.lang.String ddnames)
        Set the DDs required by the MVS module
        Parameters:
        ddnames - the DD names
      • pgm

        public MVSExec pgm(java.lang.String pgm)
        Set the name of MVS module to execute
        Parameters:
        pgm - the name of the MVS module
        Returns:
        this instance
      • parm

        public MVSExec parm(java.lang.String parm)
        Set the parameters to be passed to the MVS module
        Parameters:
        parm - the parameters
        Returns:
        this instance
      • ddnames

        public MVSExec ddnames(java.lang.String ddnames)
        Set the DDs required by the MVS module
        Parameters:
        ddnames - the DD names
        Returns:
        this instance
      • copy

        public MVSExec copy(CopyToHFS copy)
        Adds a CopyToHFS command that will be executed after the program is executed but before the DD statements are freed.

        Useful for copying/storing compile log files from temporary PDS to HFS files.

        Parameters:
        copy - CopyToHFS command
        Returns:
        this instance
      • file

        public MVSExec file(java.lang.String file)
        Set the file that this command is processing.
        Parameters:
        file - the relative path of the file.
        Returns:
        this instance
      • isFreePgmAllocatedDDs

        public boolean isFreePgmAllocatedDDs()
        Return true if the DDs allocated by programs should be freed. Default value is false
        Returns:
        true if the DDs allocated by programs should be freed
      • setFreePgmAllocatedDDs

        public void setFreePgmAllocatedDDs(boolean freePgmAllocatedDDs)
        Set whether the DDs allocated by the program should be freed. Some compilers (C and REXX compilers) often allocate temporary DD when another files are included, these DDs are not freed by the compilers. In such case, set this to true so that these DDs are freed after the compiler has completed.
        Parameters:
        freePgmAllocatedDDs - true or false
      • freePgmAllocatedDDs

        public MVSExec freePgmAllocatedDDs(boolean freePgmAllocatedDDs)
        Set whether the DDs allocated by the program should be freed. Some compilers (C and REXX compilers) often allocate temporary DD when another files are included, these DDs are not freed by the compilers. In such case, set this to true so that these DDs are freed after the compiler has completed.
        Parameters:
        freePgmAllocatedDDs - true or false
        Returns:
        this instance of MVSExec

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