locked
Flat File Debatching RRS feed

  • Question

  • For one of the requirement, we need to debatch the incoming flat file. The incoming flat file contains 1 header record and multiple body records. Below is the incoming input file.

    SpotForward TradeDate SettleDate Acct Side Cur GivenAmount SpotRate FwdPts AllInRate AltCur AlternateAmount Broker ClientOrderID Portfolio Symbol

    Spot 10/4/2012 10/5/2012 10022H10 BUY USD 6861.76 1.61 0 1.61 GBP 4261.96 NTH 1551869363 10022H10 GBP/USD

    Forward 10/4/2012 12/31/2012 10022H10 BUY JPY 1000 127.115 -0.137 126.978 GBP 7.88 NTH 1551869365 10022H10 GBP/JPY

    I have created 2 schemas, one as details and another as a envelope schema. . First one is the Details schema and second one is the Envelope schema .

    If i try to validat the input file against the envelope schema it passes but If i try to validate the input file against the details schema it fails.
    But if i change the input file and add a TAB at the end of each record and change the child Order for /schema/detail to Postfix,
    it actually validates the file. But in my input file records are separated by CRLF and within each record details are separated by TAB

    Can someone help me to debatch the incoming file.

    Thursday, October 18, 2012 6:46 AM

Answers

  • Have you seen this blog post at the end of the blog all the details has been provided on how to debatch the message having header.


    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

    Thursday, October 18, 2012 8:31 AM
    Moderator
  • Seems your last records doesn't have CR LF. Looks like you have to use Infix for the Records.

    I would suggest to generate an instance file from your schemas and compare them with your test file. In this way you find out the source of your issue.


    Leonid Ganeline [BizTalk MVP] BizTalkien: Advanced Questions

    Thursday, October 18, 2012 2:58 PM
    Moderator

All replies

  • Have you seen this blog post at the end of the blog all the details has been provided on how to debatch the message having header.


    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

    Thursday, October 18, 2012 8:31 AM
    Moderator
  • see Microsoft Sample Available:

    C:\Program Files\Microsoft BizTalk Server 2010\SDK\Samples\Pipelines\AssemblerDisassembler\EnvelopeProcessing

    Download

    Thursday, October 18, 2012 9:00 AM
  • Hi Rohit,

    Thanks for your post . it is really helpful.

    But when if i am following the same, i am getting a different output.

    For a input file with 1 header + 4 records I am getting 3 records in ouput. somehow the first record in the output file concatenates the second record also.. Let me share the error in eventvwr.

    <Root xmlns="**"><Fills xmlns=""><SpotForward>10/4/2012</SpotForward><TradeDate>10/5/2012</TradeDate><SettleDate>10022H10</SettleDate><Acct>BUY</Acct><Side>USD</Side><Cur>6861.76</Cur><GivenAmount>1.61</GivenAmount><SpotRate>0</SpotRate><FwdPts>1.61</FwdPts><AllInRate>GBP</AllInRate><AltCurrency>4261.96</AltCurrency><AlternateAmount>NTH</AlternateAmount><Broker>1551869363</Broker><ClientOrderID>10022H10</ClientOrderID><Portfolio>GBP/USD

    Spot</Portfolio><Symbol>10/4/2012 10/5/2012 10022H10 BUY USD 3000 1.61 0 1.61 GBP 1863.35 NTH 1551869364 10022H10 GBP/USD</Symbol></Fills></Root>.

    Note : i have replaced namespace value with ** .

    Thursday, October 18, 2012 1:39 PM
  • Seems your last records doesn't have CR LF. Looks like you have to use Infix for the Records.

    I would suggest to generate an instance file from your schemas and compare them with your test file. In this way you find out the source of your issue.


    Leonid Ganeline [BizTalk MVP] BizTalkien: Advanced Questions

    Thursday, October 18, 2012 2:58 PM
    Moderator