Application Development 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: 

Hw to use Split command

former_member575017
Participant
0 Kudos

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

Former Member
0 Kudos

Use this code.

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

8 REPLIES 8

JozsefSzikszai
Active Contributor
0 Kudos

you need to use offset (not SPLIT)

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

0 Kudos

Thanks all, I got the solution.

Regards

Basu

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

Former Member
0 Kudos

Use this code.

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

Former Member
0 Kudos

Hi,

Check the FM: 'STRING_SPLIT_AT_POSITION'.

Regards,

Bhaskar

Former Member
0 Kudos

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

Former Member
0 Kudos

str1 = string(10).

str2 = string+10(8).

str3 = string+18(8).

use offsets

else u can use ... FM

STRING_SPLIT_AT_POSITION

STRING_SPLIT

Former Member
0 Kudos

Hi,

ex: V1 = 28890990888899987666667889

V2 = V1+0(10),

V3 = V1+10(8),

V4 = V1+18(8),

Former Member
0 Kudos

data : stng type string.

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

stng = '28890990888899987666667889'.

stng1 = stng(10).

stng2 = stng+10(8).

stng3 = stng+18(8).