com.ibm.dbb.build

Class CopyToHFS

  • java.lang.Object
    • com.ibm.dbb.build.CopyToHFS
  • All Implemented Interfaces:
    IExecute


    public class CopyToHFS
    extends java.lang.Object
    implements IExecute
    This command can be used to copy a partitioned dataset (PDS) member to an HFS file.

    Usage:

     CopyToHFS copyCmd = new CopyToHFS();
     copyCmd.setDataset(HLQ + "COBOL");
     copyCmd.setMember("EPSNBRVL");
     copyCmd.setFile(new File(SRC_DIR + "/epsnbrvl.cbl"));
     copyCmd.copy();
     
    This class also supports chaining:
     new CopyToHFS().dataset(HLQ + "COBOL").member("EPSNBRVL").file(new File(SRC_DIR + "/epsnbrvl.cbl")).copy();
     
    • Constructor Summary

      Constructors 
      Constructor and Description
      CopyToHFS() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      CopyToHFS append(boolean append)
      Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.
      CopyToHFS convertControlCharacters(boolean convertControlCharacters)
      Specify whether the control characters should be converted to space during copying a PDS member to HFS file.
      void copy()
      Executes the CopyToHFS command
      CopyToHFS copyMode(DBBConstants.CopyMode copyMode)
      Set the mode used by the copy.
      CopyToHFS dataset(java.lang.String dataset)
      Set the data set containing the member to copy from
      CopyToHFS ddName(java.lang.String ddName)
      Set the dd to copy from
      int execute()
      Executes the CopyToHFS command
      CopyToHFS file(java.io.File file)
      Set the target file on HFS
      DBBConstants.CopyMode getCopyMode()
      Return the mode used by the copy.
      java.lang.String getDataset()
      Retrieve the data set containing the member to copy from
      java.lang.String getDdName()
      Retrieve the DD to copy from
      java.io.File getFile()
      Retrieve the target file on HFS
      java.lang.String getHFSEncoding()
      Retrieve the target HFS file encoding.
      java.lang.String getMember()
      Retrieve the member to copy from
      java.lang.String getPDSEncoding()
      Retrieve the source PDS member encoding.
      java.lang.String getReadOptions()
      Retrieve additional read options used by z/OS C library I/O functions.
      java.lang.String getVolser()
      Return the volume serial of the data set
      CopyToHFS hfsEncoding(java.lang.String encoding)
      Set the target HFS file encoding.
      boolean isAppend()
      Retrieve flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.
      boolean isConvertControlCharacters()
      Return whether the control characters should be converted to space during copying a PDS member to HFS file.
      CopyToHFS member(java.lang.String member)
      Set the member to copy from
      CopyToHFS pdsEncoding(java.lang.String encoding)
      Set the source PDS member encoding.
      CopyToHFS readOptions(java.lang.String options)
      Set the read options
      void setAppend(boolean append)
      Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.
      void setConvertControlCharacters(boolean convertControlCharacters)
      Specify whether the control characters should be converted to space during copying a PDS member to HFS file.
      void setCopyMode(DBBConstants.CopyMode copyMode)
      Set the mode used by the copy.
      void setDataset(java.lang.String dataset)
      Set the data set containing the member to copy from
      void setDdName(java.lang.String ddName)
      Set the DD to copy from
      void setFile(java.io.File file)
      Set the target file on HFS
      void setHFSEncoding(java.lang.String encoding)
      Set the target HFS file encoding.
      void setMember(java.lang.String member)
      Set the member to copy from
      void setPDSEncoding(java.lang.String encoding)
      Set the source PDS member encoding.
      void setReadOptions(java.lang.String options)
      Set additional read options used by z/OS C library I/O functions.
      void setVolser(java.lang.String volser)
      Specify the volume serial of the data set
      CopyToHFS volser(java.lang.String volser)
      Specify the volume serial of the data set
      • Methods inherited from class java.lang.Object

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

      • CopyToHFS

        public CopyToHFS()
    • Method Detail

      • copy

        public void copy()
                  throws java.io.IOException
        Executes the CopyToHFS command
        Throws:
        java.io.IOException - If an error occurred when copying the file.
      • execute

        public int execute()
                    throws BuildException
        Executes the CopyToHFS command
        Specified by:
        execute in interface IExecute
        Returns:
        The integer RC from the z/OS executed program.
        Throws:
        BuildException - If an error occurred when copying the file.
      • getFile

        public java.io.File getFile()
        Retrieve the target file on HFS
        Returns:
        the target file
      • setFile

        public void setFile(java.io.File file)
        Set the target file on HFS
        Parameters:
        file - the target file
      • getReadOptions

        public java.lang.String getReadOptions()
        Retrieve additional read options used by z/OS C library I/O functions.
        Returns:
        Additional z/OS C library I/O function read options.
      • setReadOptions

        public void setReadOptions(java.lang.String options)
        Set additional read options used by z/OS C library I/O functions. Optional, will minimally include 'r'.
        Parameters:
        options - Additional z/OS C library I/O function read options.
      • isAppend

        public boolean isAppend()
        Retrieve flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists.
        Returns:
        Flag value if PDS member should be appended to existing HFS file.
      • setAppend

        public void setAppend(boolean append)
        Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists. Optional, default is false.
        Parameters:
        append - - True if PDS member content should be concatenated to existing target HFS file.
      • setHFSEncoding

        public void setHFSEncoding(java.lang.String encoding)
        Set the target HFS file encoding. Optional, default is 'Cp1047' - EBCDIC
        Parameters:
        encoding - Target HFS file encoding.
      • setPDSEncoding

        public void setPDSEncoding(java.lang.String encoding)
        Set the source PDS member encoding. Optional, default is 'Cp1047' - EBCDIC
        Parameters:
        encoding - Source PDS member encoding.
      • getHFSEncoding

        public java.lang.String getHFSEncoding()
        Retrieve the target HFS file encoding. Optional, default is 'Cp1047' - EBCDIC
        Returns:
        The target HFS file encoding.
      • getPDSEncoding

        public java.lang.String getPDSEncoding()
        Retrieve the source PDS member encoding. Optional, default is 'Cp1047' - EBCDIC
        Returns:
        The source PDS member encoding.
      • getMember

        public java.lang.String getMember()
        Retrieve the member to copy from
        Returns:
        the member to copy
      • setMember

        public void setMember(java.lang.String member)
        Set the member to copy from
        Parameters:
        member - the member to copy
      • getDataset

        public java.lang.String getDataset()
        Retrieve the data set containing the member to copy from
        Returns:
        the data set
      • setDataset

        public void setDataset(java.lang.String dataset)
        Set the data set containing the member to copy from
        Parameters:
        dataset - the data set
      • getDdName

        public java.lang.String getDdName()
        Retrieve the DD to copy from
        Returns:
        the DD name
      • setDdName

        public void setDdName(java.lang.String ddName)
        Set the DD to copy from
        Parameters:
        ddName - the DD name
      • dataset

        public CopyToHFS dataset(java.lang.String dataset)
        Set the data set containing the member to copy from
        Parameters:
        dataset - the dataset
        Returns:
        this instance
      • member

        public CopyToHFS member(java.lang.String member)
        Set the member to copy from
        Parameters:
        member - the member
        Returns:
        this instance
      • ddName

        public CopyToHFS ddName(java.lang.String ddName)
        Set the dd to copy from
        Parameters:
        ddName - the DD name
        Returns:
        this instance
      • file

        public CopyToHFS file(java.io.File file)
        Set the target file on HFS
        Parameters:
        file - the target file
        Returns:
        this instance
      • readOptions

        public CopyToHFS readOptions(java.lang.String options)
        Set the read options
        Parameters:
        options - the read options
        Returns:
        this instance
      • append

        public CopyToHFS append(boolean append)
        Set flag indicating if the content of the PDS member should be concatenated to the target HFS file if already exists. Optional, default is false.
        Parameters:
        append - - True if PDS member content should be concatenated to existing target HFS file.
        Returns:
        this instance
      • hfsEncoding

        public CopyToHFS hfsEncoding(java.lang.String encoding)
        Set the target HFS file encoding. Optional, default is 'Cp1047' - EBCDIC
        Parameters:
        encoding - Target HFS file encoding.
        Returns:
        this instance
      • pdsEncoding

        public CopyToHFS pdsEncoding(java.lang.String encoding)
        Set the source PDS member encoding. Optional, default is 'Cp1047' - EBCDIC
        Parameters:
        encoding - Source PDS member encoding.
        Returns:
        this instance
      • getCopyMode

        public DBBConstants.CopyMode getCopyMode()
        Return the mode used by the copy. Possible values are: TEXT, ASA_TEXT, BINARY, LOAD. Default value is TEXT.
        Returns:
        the mode used by the copying process
      • setCopyMode

        public void setCopyMode(DBBConstants.CopyMode copyMode)
        Set the mode used by the copy. Possible values are: TEXT, ASA_TEXT, BINARY, LOAD. If mode is set to BINARY or LOAD, then hfsEncoding and pdsEncoding are ignored.
        Parameters:
        copyMode - set the mode used by the copy
      • copyMode

        public CopyToHFS copyMode(DBBConstants.CopyMode copyMode)
        Set the mode used by the copy. Possible values are: TEXT, ASA_TEXT, BINARY, LOAD. If mode is set to BINARY or LOAD, then hfsEncoding and pdsEncoding are ignored.
        Parameters:
        copyMode - set the mode used by the copy
        Returns:
        this instance
      • getVolser

        public java.lang.String getVolser()
        Return the volume serial of the data set
        Returns:
        the volume serial of the data set
        Since:
        1.0.3
      • setVolser

        public void setVolser(java.lang.String volser)
        Specify the volume serial of the data set
        Parameters:
        volser - the volume serial of the data set
        Since:
        1.0.3
      • volser

        public CopyToHFS volser(java.lang.String volser)
        Specify the volume serial of the data set
        Parameters:
        volser - the volume serial of the data set
        Returns:
        the current instance of com.ibm.dbb.build.CopyToHFS
        Since:
        1.0.3
      • isConvertControlCharacters

        public boolean isConvertControlCharacters()
        Return whether the control characters should be converted to space during copying a PDS member to HFS file.
        Returns:
        true if the control characters should be converted to space, false otherwise.
      • setConvertControlCharacters

        public void setConvertControlCharacters(boolean convertControlCharacters)
        Specify whether the control characters should be converted to space during copying a PDS member to HFS file. This setting is only for CopyMode.TEXT.
        Parameters:
        convertControlCharacters - true if the control characters should be converted to space.
      • convertControlCharacters

        public CopyToHFS convertControlCharacters(boolean convertControlCharacters)
        Specify whether the control characters should be converted to space during copying a PDS member to HFS file. This setting is only for CopyMode.TEXT.
        Parameters:
        convertControlCharacters - true if the control characters should be converted to space.
        Returns:
        the current instance of com.ibm.dbb.build.CopyToHFS
        Since:
        1.0.4

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