1

How can I load BAI2 file to SSIS? .BAI2 is an industry standard format used by the banks. Below is the one truncated example

01,021000021,CST_USER,110520,1610,1627,,,2/
02,CST_USER,089900137,1,110509,1610,,2/ 
03,000000370053368,USD,010,782711622,,,015,7620008 12,,,040,760753198,,/ 
88,043,760000052,,,045,760010026,,,050,760000040,, ,055,760000045,,/ 
James Z
  • 12,209
  • 10
  • 24
  • 44
Pavan
  • 15
  • 3
  • i think the following answer contains all what you need from programming perspective. considering what you mentioned*`The Issue is we have to run those dynamically. I am not sure the banks maintain the BAI2 file standard format across the glob`* you should ask a domain expert (banking, transactions) to give you a good answer. And it is good to check the [Tour page](https://www.stackoverflow.com/tour) to learn more about the site rules (asking good questions, accepting and up-voting good answers ...) – Yahfoufi Mar 02 '19 at 11:11

1 Answers1

1

Use a Flat file connection manager

I think you can import these files using a flat file connection manager, because they are similar to comma separated text, try to change the row delimiter and column delimiter properties to find the appropriate one.

From the example you mentioned i think you should use:

,  as Column delimiter
/  as Row delimiter 

To learn more about how to interpret a BAI2 file check the following link:

Based on this link:

The BAI2 file is a plain text file (.TXT Format), which contains values / texts one after the other.

Because the number of columns is not fixed among all rows than you must use define only one column (DT_STR,4000) in the flat file connection manager, and split columns using a Script Component:

Helpful links

Hadi
  • 36,233
  • 13
  • 65
  • 124
  • I am sure we have to use Script task for BAI2. anybody can help on code by using /bai2 file – Pavan Feb 28 '19 at 20:36
  • here is the reference link https://stackoverflow.com/questions/27280516/processing-reading-bai2-files-in-java – Pavan Feb 28 '19 at 20:42
  • @Pavan check this link https://blogs.sap.com/2015/10/20/ebs-how-to-interpret-a-bai2-file/ – Hadi Feb 28 '19 at 20:43
  • 1
    thanks a lot I will go through your link and let you know. Thanks again for quick response.. – Pavan Feb 28 '19 at 21:28
  • May I know the headers of the BAI2 file? – Pavan Mar 01 '19 at 13:29
  • @Pavan there isno fixed headers. You have to read the row as on column and split it using a script. Check the links i provided – Hadi Mar 01 '19 at 13:32
  • The Issue is we have to run those dynamically. I am not sure the banks maintain the BAI2 file standard format across the glob? – Pavan Mar 01 '19 at 13:37
  • @Pavan I think this part is not a programming issue. You will not find an answer on stackoverflow – Hadi Mar 01 '19 at 13:58