0

We have to store data from some flat files that is created using IBM's Ab-Initio product. They have their own datatypes that I need to map to java data-types while I process that data in java.

Does anyone know what would a good technique to do so ? Are their any java APIs to do so ?

simplest technique I have in mind is to create a map of Ab-Initio to Java type after checking the size in Ab-Initio and choosing datatype that represents that size and type in Java.

Any inputs are appreciated !

Thanks, -JJ

Dónal Boyle
  • 3,049
  • 2
  • 25
  • 40
user656189
  • 139
  • 8
  • 17

2 Answers2

1

When converting data between various languages I like to stick to a couple basic data structures which seem to be able to handle any type of data:

  1. Primitives - for storing basic values like strings and numbers.
  2. Maps - for associating properties with values for an object.
  3. Lists - for storing sequences of primitives and objects.

Of course, in Java, it's canonical to create an object with bean properties instead of a Map when the full domain of attributes is known.

maerics
  • 151,642
  • 46
  • 269
  • 291
  • My question was more like, if say you have : namevarchar20, you will make name a string java. So, how we create this mapping program. Should we make a mapping list that if input is varchar, create java type string. if input is float, make java type float etc. And then use this mapping to create java types from a fixed lenth line ? – user656189 Mar 17 '11 at 20:44
0

In most ab-inito processes, just before a flat file is written, some transformation is performed on the data, even if there in no transformation performed, before writing to the file, or a step before the step that writes to the file, an intermediate DML is present which contains the data definitions for each columns, most of these are generic definitions, all you need to do is ask the ab-initio developer to send you a copy of that generic dml, and then you can you this DML to map values in java. Hope this helps.

Sameer
  • 757
  • 1
  • 14
  • 35