Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

UDF for creating target field based on length

$
0
0

Hi Experts,

 

Here is my mapping requirement.

 

If source value is blank then do not specify the target segment (let's say NAME is target segment name).Form as many target field (lets say name is FIELD) instances (80 chars each) as necessary to accommodate the full length of source value . If special characters * and ~ are found, replace each with a space.

 

I have 3 conditions here.

 

---> If source is blank do not specifiy target segment

--->From source i may get value more than 255 characters, target field maximum length is 80, so i need to create more target instances to accomodate full length of source field

---> if special characters * and ~ I need to replace with space.

 

Can you help to craete UDF which will satify all the above 3 conditions. Thanks for your help.

 

Source xml:

 

   <row>

<source>123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789</source>

   </row>

 

Expected target xml:

 

<Result>

<TARGET>

<FIELD>12345678912345678912345678912345678912345678912345678912345678912345678912345678</FIELD>

<FIELD>91234567891234567891234567891234567891234567891234567891234567891234567891234567</FIELD>

<FILED>91234567891234567891234567891234567891234567891234567891234567891234567891234567</FIELD>

<FIELD>89123456789123456789123456789123456789</FIELD>

</TARGET>

</Result>


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>