cancel
Showing results for 
Search instead for 
Did you mean: 

Transpose Flat File Structure

Former Member
0 Kudos

Hello Pros

I have a requirement where I need to transpose a structure. My input is illustrated below. In this example the output file has one u201Cheader level recordu201D, two u201CIntermediate level recordsu201D, and four u201CItem level recordsu201D (2items per Intermediate record, hence 4 total item level records).

I assume to achieve this in a 2 step process. First I had a MM for idoc>file to populate my dataset. Now Iu2019m attempting to transpose the structure as a second MM step. Originally I attempted to do this in 1 step and thought successful but where I fell short was the u201Cintermediate levelu201D records in the 3rd and 4th positions (see output below) pulled incorrect values when transposed.

Input Nodes:

<HeaderRequest>

<HeaderRecrod1/>

<HeaderRecrod2/>

<IntermediateRequest>

<intermediate1/>

<intermediate2/>

<ItemRequest>

<item1/>

<item2/>

</ItemRequest>

</IntermediateRequest>

</HeaderRequest>

The output I require is noted below.

Output Nodes

RecordInformation

HeaderRequest u2026 (headerRequest1>IntermediateRequest1>itemRequest1.1)

HeaderRequest u2026 (headerRequest1>IntermediateRequest1>itemRequest1.2)

HeaderRequest u2026 (headerRequest1>IntermediateRequest2>itemRequest2.1)

HeaderRequest u2026 (headerRequest1>IntermediateRequest2>itemRequest2.2)

Please note, lets just say there is no data in u201CHeaderRecord1u201D (see u201Cinputu201D structure above) trying to utilize u201CuseoOeAsManyu201D will throw an error.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try using the Constants function CopyValue[0] with index 0

Regards,

Aravind

Former Member
0 Kudos

Hi Aravind-

Thank you for your feedback. With a little trial and error I came up with 3 alternatives and that was the first but it only solved the problem when seeking the first cardinal position in the queue. I resolved the issue. Points awareded.