cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to truncate some characters in the source field

Former Member
0 Kudos

Hi all,

My source field is 18 characters , the target field is 15 characters.Si i need to drop the 3rd, 4th and 5th character from the source file.Can any body help me with the UDF to be written during the mapping

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Priya,

You can use the standard function as described above.

But you should also check whether the field is populated or not. If the field is not populated, the standard function will still try to execute the substring function; and in that case, it will throw a runtime mapping error.

Regards,

Neetesh

jyothi_anagani
Active Contributor
0 Kudos

Hi Priya,

UDF is not required. Do The Mapping as suggested by RAJA..

Do It Like This


Input ------> subString(0,2) -----\
                                   -------->Concat[]----->output
input ------->subString(5,13)-----/

Regards

Jyothi A

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

without using UDF you can easily achive this requiremennt.

use substring function to split data,

First split data in to two caracters (first and second)

then use one more subtring function to split data from 6 th character to 18 th character ,

then append(concat) these two and send it to target.

Regards,

Raj