cancel
Showing results for 
Search instead for 
Did you mean: 

How i can truncate the data, if source field is longer than target field

Former Member
0 Kudos

Hi,

if source field value(text) is longer than target field value, then how i will truncate the data to fit the exisitng maximum length in message mapping.

Thanks in advance.

Thanks and Regards

Sai

Accepted Solutions (0)

Answers (5)

Answers (5)

aashish_sinha
Active Contributor
0 Kudos

Hi ,

I can give you the logic like this.

TLength = XXX;

SLength = Source.length;

if (SLength <= TLength)

Map it to target as it is;

else

{

target = Source.substring(0,TLength);

}

Write it as an UDF or do it in graphical mapping as you like it. This is what logic you are supposed to implement.

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

Hi,

We can Use Substring Function

Regards

Seshagiri

Former Member
0 Kudos

Hi Komala,

You can use the Substring function provided in Message Mapping under Text Functions or you could go in for a UDF ( User Defined Function )

In the SubString Function you can specify the Starting Position and the number of characters you require thereof.

**************Reward points ,if found useful

Former Member
0 Kudos

Hi,

In graphical mapping u have predefined function called sub string tyr to use it.

ex: if u need only 10 chars at target side.

sustring(0,10).

Thanks and regards,

Phani

former_member859847
Active Contributor
0 Kudos

Hi,

Use standard functions as

source filed->length->if then else ->substring->target.

regards

mahesh.