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

Hw to use Split command

former_member575017
Participant
0 Likes
1,487

Hi Experts,

I have one field with 26 char length and I want split it at 10, 8,8.

ex: 28890990888899987666667889

Plz help me.

Thanks

Basu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,408

Use this code.

first  = string+0(10)
second = string+10(8)
third = string+18(8)

8 REPLIES 8
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,408

you need to use offset (not SPLIT)

string1 = string(10).
string2 = string+10(8).
string3 = string+18(8).

Read only

0 Likes
1,408

Thanks all, I got the solution.

Regards

Basu

Edited by: Basanagouda Sasanur on Nov 6, 2008 11:20 AM

Read only

Former Member
0 Likes
1,409

Use this code.

first  = string+0(10)
second = string+10(8)
third = string+18(8)

Read only

Former Member
0 Likes
1,408

Hi,

Check the FM: 'STRING_SPLIT_AT_POSITION'.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,408

Hi,,,,,

Instead of using split do it like this this more robust.....

data: a type string,

b type string,

c type string,

d type string value '28890990888899987666667889',

seperator type c value ',',

l type string,

count type i.

count = strlen( d ).

a = d+0(10).

b = d+10(8).

c = d+18(8).

concatenate a b c into l separated by seperator.

write:/ l.

Thanks

Saurabh

Read only

Former Member
0 Likes
1,408

str1 = string(10).

str2 = string+10(8).

str3 = string+18(8).

use offsets

else u can use ... FM

STRING_SPLIT_AT_POSITION

STRING_SPLIT

Read only

Former Member
0 Likes
1,408

Hi,

ex: V1 = 28890990888899987666667889

V2 = V1+0(10),

V3 = V1+10(8),

V4 = V1+18(8),

Read only

Former Member
0 Likes
1,408

data : stng type string.

data : stng1(10) , stng2(8) , stng3(8).

stng = '28890990888899987666667889'.

stng1 = stng(10).

stng2 = stng+10(8).

stng3 = stng+18(8).