Copy Utility

  • Copy Menu
  • Standard Copy
  • Cobol Copy
  • Copy to delimited (CSV)
  • Batch Copy
  • Copy to Delimited File
  • Copy From XML

  • Copy Utility

    The copy utility can be run either three ways:


    Copy Menu

    When you a start the copy utility, the following screen is displayed:

    The options are:

    1. Run stored Copy Lets you run a stored Copy-Definition. All other options let you the copy details to a XML file, this option lets you run these saved definitions.

    2. Standard Copy Copies data from one file to another using 2 supplied record layouts. See "Standard Copy" for more details. This option can copy Fixed to Fixed, Fixed to and from Delimited and XML to either fixed or delimited files.

    3. Cobol Copy Copies a file from one Cobol Dialect to another. See "Cobol Copy" for more details.

    4. Copy to delimited Copies a file (using supplied Record Layout) to a Delimited (CSV) file. It can be used to copy a Fixed format file to delimited or delimited to delimited. See "Copy to delimited (CSV)" for more details.

    5. Copy using Velocity Template. This option sends the contents of a file to a Velocity Template. It is ideal for reformatting Cobol files as text files (i.e. HTML or XML).

    Standard Copy

    This option will copy a file from one format (defined in a record-layout) to another format (defined by a different record-layout). It can

    File Definition Screen  This screen lets you define a file and its Record Layout. It is displayed for both input File and the output file.

    Field Definition  After entering the Input / Output Files, the Field definition screen is display. On this screen you define which Record & Field are to be copied an where they should be copied to.

    Final Screen 

    The final screen lets you

    Cobol Copy

    This option copies a file from one Cobol Dialect to another Cobol dialect.

    Fields are

    Old File

    Existing file to be converted

    New File

    Output File name

    Copybook

    Cobol Copybook for the file

    Input File Structure

    The format of the file, uuse normal for line sequential, Fixed length Binary for file with all records the same length or the appropriate VB format for other files.

    Input Numeric Format

    Choose the numeric format appropriate to your version of Cobol.

    Input File Structure

    The format of the file, uuse normal for line sequential, Fixed length Binary for file with all records the same length or the appropriate VB format for other files.

    Input Numeric Format

    Choose the numeric format appropriate to your version of Cobol.

    The next screen displayed is the "final screen" where you can

    Copy to delimited (CSV)

    File definitions  On the first screen you enter the input & output files, Record Layout of the input file + delimited file details.

    Field Selection  The second screen is the field Selection screen:

    Final Screen 

    On the final screen you can:


    Batch Copy

    Also provided is the batch copy (either runBatchCopy.bat or runBatchCopy.sh) utility.

    Usage

          runBatchCopy.sh savedCopyDefinition.xml
     or
         runBatchCopy.sh savedCopyDefinition.xml -i Input_File -o Output_File
     
     
    


    Copy to Delimited File

    There are actually 2 ways to copy a Fixed / Delimited file to a Delimted file:

    1. Via option 4 "Copy to delimited (CSV)" screen.

    2. You can also create a Delimited Record Layout (See Tab/Comma Delimited Fields in Files in the main manual) and then use option 2 "Standard Copy" screen.

    There are 4 important parts to defining files where fields are separated by a certain character:


    Copy From XML

    While the package can copy from XML to fixed / delimited; The fixed / delimited layout must be setup to match the input Xml exactly.

    At present, you can not copy from Fixed / Delimited to Xml but in the Editor you can:

    To Copy an XML file, you should Select option 1 "Standard Copy" and the layout for the Xml file should be Xml - Build Layout (or a specific XML layout can also be used). After this it is, it is like a normal copy.