Class UnisysDataConvertor

java.lang.Object
com.softwaremining.jcl.UnisysDataConvertor

public class UnisysDataConvertor extends Object
EBCDIC To ASCII Data Migration utility class LIMITATION: When dealing with classes which have fields REDEFINED, then the system will only act on the FIRST FIELD. E.g. 05 VAR1 PIC 9(5) COMP. 05 VAR1R PIC X(3) REDEFINES VAR1. The system will use VAR1 for data migration. However, this could produce incorrect results when: 05 VAR1 PIC X(3) REDEFINES VAR1. 05 VAR1R PIC 9(5) COMP. Also, the system will not be able to handle complicated REDEFINED cases. e.g. 03 GROUP-1. 05 VAR1 PIC 9(5) COMP. 03 GROUP-1-R REDEFINES GROUP-1. 05 VAR1R PIC X(3) .
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final void
    asciiToEbcdic(CBLBean dataClass, String inputFileName, String outputFileName)
    Convert a datafile containing ASCII datafile to EBCDIC Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields.
    static final void
    asciiToEbcdic(CBLBean dataClass, String inputFileName, String outputFileName, int forceNewLineType)
    Convert a datafile containing ASCII datafile to EBCDIC Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields.
    static void
    convertRecordLine(char[] nextLine, List<AbstractCBLField> fieldList, boolean unisysToIBM)
    convert a string line for the record containing Fields
    static void
    main(String[] args)
    command line startup ...
    static final void
    unisysToIBM(CBLBean dataClass, String inputFileName, String outputFileName)
    Convert a datafile containing EBCDIC datafile to ASCII Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields.
    static final void
    unisysToIBM(CBLBean dataClass, String inputFileName, String outputFileName, int forceNewLineType)
    Convert a datafile containing EBCDIC datafile to ASCII Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UnisysDataConvertor

      public UnisysDataConvertor()
  • Method Details

    • unisysToIBM

      public static final void unisysToIBM(CBLBean dataClass, String inputFileName, String outputFileName) throws IOException
      Convert a datafile containing EBCDIC datafile to ASCII Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields. Ie it cannot be used with a persistenceFile which contains a large Filler definition. LIMITATION: Does not work with classes containing REDEFINED items
      Parameters:
      dataClass - : Class representing the structure of to the datafile
      inputFileName - - full name/path of the ebcidic datafile
      OutputFileName - - full name./path of the target ASCII file.
      Throws:
      IOException
    • unisysToIBM

      public static final void unisysToIBM(CBLBean dataClass, String inputFileName, String outputFileName, int forceNewLineType) throws IOException
      Convert a datafile containing EBCDIC datafile to ASCII Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields. Ie it cannot be used with a persistenceFile which contains a large Filler definition. LIMITATION: Does not work with classes containing REDEFINED items
      Parameters:
      dataClass - : Class representing the structure of to the datafile
      inputFileName - - full name/path of the ebcidic datafile
      OutputFileName - - full name./path of the target ASCII file.
      forceNewLine - - add a new LF/CR after each migrated record is written.
      Throws:
      IOException
    • asciiToEbcdic

      public static final void asciiToEbcdic(CBLBean dataClass, String inputFileName, String outputFileName) throws IOException
      Convert a datafile containing ASCII datafile to EBCDIC Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields. Ie it cannot be used with a persistenceFile which contains a large Filler definition. LIMITATION: Does not work with classes containing REDEFINED items
      Parameters:
      dataClass - : Class representing the structure of to the datafile
      inputFileName - - full name/path of the ASCII datafile
      OutputFileName - - full name./path of the target EBCDIC file.
      Throws:
      IOException
    • asciiToEbcdic

      public static final void asciiToEbcdic(CBLBean dataClass, String inputFileName, String outputFileName, int forceNewLineType) throws IOException
      Convert a datafile containing ASCII datafile to EBCDIC Note that the persistenceFile should contain the full definition of the Binary and Non-binary fields. Ie it cannot be used with a persistenceFile which contains a large Filler definition. LIMITATION: Does not work with classes containing REDEFINED items
      Parameters:
      dataClass - : Class representing the structure of to the datafile
      inputFileName - - full name/path of the ASCII datafile
      OutputFileName - - full name./path of the target EBCDIC file.
      Throws:
      IOException
    • main

      public static void main(String[] args)
      command line startup ...
      Parameters:
      args -
    • convertRecordLine

      public static void convertRecordLine(char[] nextLine, List<AbstractCBLField> fieldList, boolean unisysToIBM)
      convert a string line for the record containing Fields
      Parameters:
      nextLine -
      fieldList -
      unisysToIBM -