cancel
Showing results for 
Search instead for 
Did you mean: 

Sort record!!

Former Member
0 Kudos

Hi Experts,

My scenario is FILE to FILE

1 file to N file

source file will contains multiple records.

i need to create target file depending upon the company code.

suppose i have 100 record in source file with

30 records with companyCode US

30 records with companyCode UK

40 records with companyCode DK...

so i have to create 3 target file and need to push 30 US record into a FILE.US

30 UK record into FILE.UK and

40 DK record into FILE.DK

can anyone gone thro such requirement??/

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Make target occurrence 0..unbounded in Messages tab

Mapping would look like

target root node mapping will look like

companyCode(set context to root) > SplitByValue(value change)-> MT_target

while configuring your scenario, interface determination should be of type Enhanced

You will get different files per value change of companyCode

Answers (2)

Answers (2)

Former Member
0 Kudos

SplitByValue function may help:

i would do something like this:

Field(context change to obtain the whole queue) => sort/sortbyKey (sort is enough in order to order the data, sortbykey is used if u need to order based in another field from another queue but they would have to be equals) => splitByvalue("value change" , that would create a new context for each separate value)

That would create 3 big queues with the values you want

- For the header target u may want to use Collapse context function which will leave u with one context per value because if you have 3 types and 30 types of values, for the header segment you only want to know that these are 3 segments:

context:

-


DK

DK

DK

-


UK

UK

UK

-


US

US

-


after collapse:

-


DK

-


UK

-


US

-


- For item level you would maintain the same logic (without the collapse) because per one "DK"/"UK"/"US" segment you would need to map the corresponding quantity obtaining one header DK and 3 items, one header UK and 3 items, one "US" with two items

Hope it's clear!

Former Member
0 Kudos

Hi Alex/kurlarni/sarvesh

thanx for your reply...

the solution u ppl provided looks good.. i am now trying out that.. but can u tell me please what configuration i have to do ..so that.. for n message n files will be created?

i can understand i have to do enhanced rcvr determination.....

Former Member
0 Kudos

change the occurence of target msg to unbounded.. and make sure multiple msg will be generated with the mapping

Former Member
0 Kudos

well, there's only two steps

First, in your map, check the "messages" tab, and change the occurrence accordingly to your need

for example: source 0.1 / target 0.unbounded

This adds segments "Messages/Messages1/" that are 0.unbounded to your message which allow you to map many files, but u may loose ur map since the root for all segments is different so keep a back up and map it as done is the first!

(if your map affects others segments (childs) use same logic, and if your field are common you need to use CopyValue function, which maps the same value in all the repetitions)

Second, in your interface determination choose enhanced type and search your interface mapping (when you create that u will also have to specify that your first message is 0.1 and the second 0.unbounded)

The enhanced Int determination (only shows multimaps like N:1, 1:N, N:M) itself creates many files so you don't have to do anything more

hope it's all clear, checking the queues will help you more, good luck!

Edited by: Alexis Alanis on Oct 24, 2008 3:30 PM

Former Member
0 Kudos

Sam,

Do you mapping like this..

Companycode(set context to root) ---> Sort -> SplitByValue(value change)-> CollepsContext ---> TargetNode.

Regards,

Sarvesh