Monday, 4 February 2013

Optional Detail in Biztalk FlatFile





Optional Detail in Biztalk FlatFile

Sample File :

0                 01CBA       CBA CARDHOLDER PAYMENTS   001666AUTO PAY DR 071197                                       
1062-789  1995201 130000064469JOHNS BOOK SHOP                 5353192380300001  062-001 10011111CBA CR CARD PMNT07001666
1062-789  1995101 130000006533JOSEPHS PRINTING                5353192413800001  062-001 10011111CBA CR CARD PMNT07001666
1062-789  1995201 130000063098JOHNS BOOK SHOP                 5353192460900001  062-001 10011111CBA CR CARD PMNT07001666
2062-789  6555102 530000102188PROPERTY SERVICES               PTMAS01           082-0016884-2222STEVE RYAN      06091710
7999-999            000013410000000000000000134100                        000003           

File Structure :

Type0- Header-Occurrence (1)-Length-120
Type1-Details1-Occurrence(0,*) -Length-121
Type2-Details2-Occurrence(0,*) -Length-121
Type7-Trailer- Occurrence (1) -Length-120



Step1:Create Schema using FlatFile Schema Wizard.




  1. Specify delimeter {cr}{lf}.
  2. Break records based on positions.
  3. Specify Tag Identifier for each  records.

Step2: Set Min and Max Occurrence for Detail1 and Detail2 Record






 Step 3 :Set Parser optimization property of schema to Complex .
 





Step 4 : Validate file without record type2.

0                 01CBA       CBA CARDHOLDER PAYMENTS   001666AUTO PAY DR 071197                                       
1062-789  1995201 130000064469JOHNS BOOK SHOP                 5353192380300001  062-001 10011111CBA CR CARD PMNT07001666
1062-789  1995101 130000006533JOSEPHS PRINTING                5353192413800001  062-001 10011111CBA CR CARD PMNT07001666
1062-789  1995201 130000063098JOHNS BOOK SHOP                 5353192460900001  062-001 10011111CBA CR CARD PMNT07001666
7999-999            000013410000000000000000134100                        000003                                       


The sample code is available for download in Code Gallery:



No comments:

Post a Comment