cancel
Showing results for 
Search instead for 
Did you mean: 

How to split a single file and then route it to different systems

Former Member
0 Kudos

Hi All,

I have a requirement like...my incoming file(single file) needs to be split into 3 files based on a field "company code".and then route it into different systems.

my incoming file is like this .....

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

EOF.

I need to split this file and my ouput file should be like this

For 1st system

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

EOF.

For 2nd system

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

EOF.

For 3rd system

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

EOF.

and then send it three systems based on company code.

Can anyone tell me how this can be achieved?

Thanks,

Hemanth.

Accepted Solutions (1)

Accepted Solutions (1)

former_member192295
Active Contributor
0 Kudos

Hi,

We can do it easily, in receiver determination conditon window put condition based on company code (it seems constant). If company code is 1 call channel one, if company code 2 call channel 2 etc. Depending on company code file name will be differ meanwhile corresponding records will be append with existing record.

or

Another way is use dynamic file naming technique in mapping itself. Depending on company code route data along with file name. Put append mode in communication channel.

Former Member
0 Kudos

Hi Nallam,

I tried the same thing but in the input file as there are different company codes,It is not splitting the file into three parts and sending only concerned data to repective system instead the whole file is going to the all the systems.

I came to know that the file has to splitted in the mapping only, we are able to do it by using mapping but the problem is in Routing,as in receiver determination we makes use of source structure for giving the condition. Can you please help me on this.

Thanks,

Hemanth.

madanmohan_agrawal
Contributor
0 Kudos

Hi Hemanth,

Create three MM and three IM. Create one RD (with condition) and three ID.

If the number of receivers are unknown then use Enhanced receiver determination to create the number of receivers at runtime.

Please take a look at the following blog.

/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

Regards,

Madan Agrawal

former_member192295
Active Contributor
0 Kudos

Hi,

I think multimapping technique will help u. According to your requirment you have three copany codes. In mapping window develop logic based on company code route data to corresponding structure. i.e. 1:3 mapping,

source.......Company code1----


MStructure1

.................Company code2.....................MStructure2

.................Company code3.....................MStructure3

Former Member
0 Kudos

Hi Madan,

Thanks for ur answer. the blog provided by you was very useful for my requirement.i am following up with that link.

Thanks,

Hemanth.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

you can achieve this without using BPM in a different way. Instead of performing 1:N mapping. Create 3 different mappings from one source message to 3 target messages. creste thre inbound interfaces, 3 receiver determinations,3 interface determinations, 3 CCs and 3 receiver agreements also.

Regards,

Reyaz

Shabarish_Nair
Active Contributor
0 Kudos

i doubt in case you have to send messages to multiple systems Enhanced (Mapping-Based) Interface Determination will work. Since receiver determination comes before interface determination.

So in your case ideal will be to have a BPM which will do the 1: N mapping and then in the receiver determination where source service is BPM and target service is your target system, use a conditional routing using XPATH in your receiver determination.

This will be your solution.

Former Member
0 Kudos

Hi sabarish,

Thanks for reply.

Is there any other solution because we dont want use BPM.

we are able to split the incoming file into 3 files using graphical mapping,but we are not able to Route it using receiver determination. Can u help me how this routing can be done?

JoelTrinidade
Active Contributor
0 Kudos

Hi ,

I dont understand what the problem is ,,, create required no. of communication channels , use enhanced interface determination wherein which you would be having one interface mapping and number of inbound message interfaces defined . Create the corresponding receiver agreements.

Regards

joel.

JoelTrinidade
Active Contributor
0 Kudos

Hi hemanth,

This can be easily handled by the mapping . Remember You would need to make use of a number enhanced interface determination in ID.

Regards

joel.