cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion

Former Member
0 Kudos

Hi,

I have to generate the following structure through sender adapter FCC..

<Message>

<Header>

<Field1>value1</Field1>

<Field2>value2</Field2>

<Record>

<Field1>value1</Field1>

<Field2>value2</Field2>

</Record>

-


<Record>

-


-


</Record>

</Header>

<Trailer>

-


</Trailer>

</Message>

my source file is coming like this:

Header 1 2 3 4 5 6 7 8

Record 1 2 3 4 5 6 7 8

Record 1 2 3 4 5 6 7 8

Record 1 2 3 4 5 6 7 8

Trailer 1 2 3 4 5 6 7 8

help me

will give points....

Accepted Solutions (0)

Answers (8)

Answers (8)

former_member181962
Active Contributor
0 Kudos
Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Could you please provide us a right example of data inside field 1 2 3 of Header Record and Trailer ?

Header 1 2 3 4 5 6 7 8

Record 1 2 3 4 5 6 7 8

Record 1 2 3 4 5 6 7 8

Record 1 2 3 4 5 6 7 8

Trailer 1 2 3 4 5 6 7 8

Because if you want to able to disguish lines of Header vs Records, you have to have a specific info and then use option KeyField. If you have not, according to me, it will be not possible to treat this flat file and then you have to contact your legacy/functional/business team to change the file format...

Example of KeyField: first character of line = H for Header, = R for Record, =T for Trailer. For KeyField you use either one character or a complete word.

Then for your XML message (so for the mapping), it 's NOT necessary to try to have that: That's a bad way (due to <Trailer> tag):

&lt;Header&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;/Header&gt;

&lt;Header&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;/Header&gt;

&lt;Trailer&gt;...&lt;/Trailer&gt;

A better solution can be generate that (with RecordSet represents a Purchase Order which can have one header and several Records...):

&lt;Recordset&gt;

&lt;Header&gt;...&lt;/Header&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Trailer&gt;...&lt;/Trailer&gt;..... which can NOT exist on the first sequences.

&lt;/Recordset&gt;

&lt;Recordset&gt;

&lt;Header&gt;...&lt;/Header&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Record&gt;...&lt;/Record&gt;

&lt;Trailer&gt;...&lt;/Trailer&gt;...... which can exist only for the last sequence.

&lt;/Recordset&gt;

And that it's easy to do it with:

Recordset name = Recordset

Recordset structure = Header,1,Record,*,Trailer,* (not 1 as there no trailer for all RecordSet but only the last one). Reminds: * = 0 or 1 or n.

Recordset per message = *

Regards.

Mickael

Edited by: Mickael Huchet on Apr 23, 2009 12:39 PM

Edited by: Mickael Huchet on Apr 23, 2009 12:46 PM

Former Member
0 Kudos

Hi,

Recordset structure required is ==HEADER,1,DATA,*,TRAILER,1

Recordset per message == *

HEADER.fieldSeparator ,

HEADER.endSeparator u2018nlu2019

HEADER.fieldNames Key,x,y,zu2026

DATA.fieldSeparator

DATA.endSeparator

DATA.fieldNames

similarly with TRAILER

Please find this blog which will be useful for your scenario

Regards,

Madhusree

Former Member
0 Kudos

Hi,

Your structure has 3 levels

<MessageType>

<Header>

<Record> </Record>

<Record> </Record>

<Record> </Record>

<Header>

<Trailer> u2026. </Trailer>

This is a complex structure. So you have to go for java mapping.

Former Member
0 Kudos

Hi,

Try using keyFieldInStructure = Ignore.

Also go through the blog given below:

/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

Thanks,

Tiny

Former Member
0 Kudos

The main concern here is how i can create the substructure "Record" withing "Header" node.

<Header>

<Record/>

<Record/>

<Trailer>

</Trailer>

The "Record" is not a field under "Header", it is a node.

Former Member
0 Kudos

Use,

Header,1,Record,*,Trailer,1

in content conversion

Former Member
0 Kudos

it will not work.