BizTalk Server General - Flat File with header and trailer

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2005 > Flat File with header and trailer





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Flat File with header and trailer
Stephen W. Thomas

2005-06-27, 5:51 pm

Hello.

I would guess that your problem is with the Trailer Schema. If you do not
have a delimiter after your trailer, you would not want that to be post
fixed. Infex might work.

Something else that might help is to use a tool like ultra edit. It will
allow you to see the hex values inside your file so you know if you are
getting a CR or a CRLF.

Hope this helps.

Stephen W. Thomas
http://www.biztalkgurus.com


"Brian Cesafsky" wrote:

> I have a flat file that has a header, body, and trailer. The header record
> is a 23 byte positional record with a line feed to end it. The body record
> is a 250 byte positional record with a line feed to end a record (the body
> record is unbounded, but I do NOT set the maxoccurs to be 'unbounded'
> because I need to promote a property). The trailer record is a 51 byte
> positional record with NOTHING that ends the record.
>
> For the header record, I set the structure property to 'delimited', the
> child order property to Postfix, and the child delimiter to 0x0A (line feed)
> for the root node, and then create a positional record for the fields
>
> For the body record, I do the same as the header record
>
> For the trailer record, I set the structure property to 'delimited', the
> child order property to Postfix, and the child delimiter to None for the
> root node, and then create a positional record for the fields
>
> I get this error:
> There was a failure executing the receive pipeline: "test.MovisoReceive"
> Source: "Flat file disassembler" Receive Location:
> "E:\Projects\BizTalk\test\IN\*.txt" Reason: Unexpected end of stream while
> looking for:
> Positional data (length is 8)
> The current definition being parsed is MovisoRecord. The stream offset where
> the error occured is 22163. The line number where the error occured is 90.
> The column where the error occured is 51.
>
>
> My guess is that BizTalk thinks I'm still processing 'body' records, but I
> don't know how to tell BTS that it has reached my trailer record.
>
> For testing, I create a receive pipeline and use a flat file disassembler.
> I set the Document, Header (preserve = false), and Trailer schemas to the
> appropriate schemas I created.
>
>
> NOTE: The input (.txt) file is being created on a Unix box I believe, so
> there is only a Line Feed (no carriage returns) after each record
>
> Thanks in advance, Brian
>
>
>

Brian Cesafsky

2005-06-27, 5:51 pm

Yep, that is the issue, there is no delimiter after the trailer. I have
used Ultra Edit to verify that. I tried Infix, but had the same error.

Still struggling...

"Stephen W. Thomas" <StephenWThomas@discussions.microsoft.com> wrote in
message news:C121441B-8E8F-45C4-BB26-B2C63B2E2D68@microsoft.com...[vbcol=seagreen]
> Hello.
>
> I would guess that your problem is with the Trailer Schema. If you do not
> have a delimiter after your trailer, you would not want that to be post
> fixed. Infex might work.
>
> Something else that might help is to use a tool like ultra edit. It will
> allow you to see the hex values inside your file so you know if you are
> getting a CR or a CRLF.
>
> Hope this helps.
>
> Stephen W. Thomas
> http://www.biztalkgurus.com
>
>
> "Brian Cesafsky" wrote:
>


Stephen W. Thomas

2005-06-27, 5:51 pm

Hello.

Did you try changing the parsing mode? The trailer doesn’t have a tag
identifier you can set does it?

Are your header and details both also marked as Post fixed? I think they
would want to be infixed as well.

Stephen W. Thomas
http://www.biztalkgurus.com


"Brian Cesafsky" wrote:

> Yep, that is the issue, there is no delimiter after the trailer. I have
> used Ultra Edit to verify that. I tried Infix, but had the same error.
>
> Still struggling...
>
> "Stephen W. Thomas" <StephenWThomas@discussions.microsoft.com> wrote in
> message news:C121441B-8E8F-45C4-BB26-B2C63B2E2D68@microsoft.com...
>
>
>

Brian Cesafsky

2005-06-27, 5:51 pm

I'm not sure how the tag identifier works... in the flat file, the first 2
characters does control what 'type' of record it is (01=header, 02=detail,
03=trailer)... do I put those values in for the tag identifier?

there is a line feed after the header, and each detail record... I have both
of those set to postfix...

I will try setting all to infixed.

One question... do I set the tag identifier on the rott record, or the
record under the root (or both?

Thanks!



"Stephen W. Thomas" <StephenWThomas@discussions.microsoft.com> wrote in
message news:6B253413-7540-4C23-89BB-B8B6FBA40E5F@microsoft.com...[vbcol=seagreen]
> Hello.
>
> Did you try changing the parsing mode? The trailer doesn't have a tag
> identifier you can set does it?
>
> Are your header and details both also marked as Post fixed? I think they
> would want to be infixed as well.
>
> Stephen W. Thomas
> http://www.biztalkgurus.com
>
>
> "Brian Cesafsky" wrote:
>


Stephen W. Thomas

2005-06-27, 5:51 pm

Hello.

Yep, you should be able to use those values as tag identifiers. That will
tell the parser what type of record it is looking for.

I think you’d need the Header and Details set to Post fixed – that means the
delimited it after the record. Leave the Trailer as Infix – that means it
doesn’t have delimiters in front or behind it.

If all else fails, you can send me your project and sample file and I can
take a look at it. Just email it to swthomas@NOSPAMbiztalkgurus.com – just
remove the nospam part.

Stephen W. Thomas
http://www.biztalkgurus.com


"Brian Cesafsky" wrote:

> I'm not sure how the tag identifier works... in the flat file, the first 2
> characters does control what 'type' of record it is (01=header, 02=detail,
> 03=trailer)... do I put those values in for the tag identifier?
>
> there is a line feed after the header, and each detail record... I have both
> of those set to postfix...
>
> I will try setting all to infixed.
>
> One question... do I set the tag identifier on the rott record, or the
> record under the root (or both?
>
> Thanks!
>
>
>
> "Stephen W. Thomas" <StephenWThomas@discussions.microsoft.com> wrote in
> message news:6B253413-7540-4C23-89BB-B8B6FBA40E5F@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com