Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Split a String

Former Member
0 Likes
1,931

Hi ,

I have a String with variable length and i have to Split it in the position 255 ,so that my target String contain 255 character and remain in other String .

Can Anyone help me how to Split in position 255.

Thanks a lot in advance .

Regards,

Tarak

5 REPLIES 5
Read only

Former Member
0 Likes
1,249

Hi,

Check the FM: STRING_SPLIT_AT_POSITION.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,249

Hi Tarak,

There is no need of SPLIT command ,

Check the below code


FIELDA  = STR(255).
FIELDB  = STR+255(255)

or use FM : STRING_SPLIT_AT_POSITION

i hope these may solve your problem.

Regards

Kumar M

Edited by: mukesh kumar on Nov 6, 2008 11:13 AM

Read only

Former Member
0 Likes
1,249

You can use FM - IQAPI_WORD_WRAP

Regards,

Aparna

Read only

Former Member
0 Likes
1,249

For this... say you have a string defined as

str1(260) type c,

str2(255) type c.

str3(100) type c.

str2 = str1. (this would move only 255 characters of str1 to str2)

str3 = str1 - str2.

so str3 string would have the remaining the part of the string.

thanks,

archana

Read only

Former Member
0 Likes
1,249

Hi,,,

Use offset concept.

data: a type string,

b type string,

d type string, >>>>>>> contains 355 characters.

data: count type i.

count = strlen( d ).

count = count - 255.

a = d+0(255).

b = d+255(count).

now your a contains 255 charactes and b contains rest of charactes.

Thanks

Saurabh