Skip to Content
avatar image
Former Member

Hw to use Split command

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 06, 2008 at 10:03 AM

    Use this code.

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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 06, 2008 at 10:00 AM

    you need to use offset (not SPLIT)

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2008 at 10:04 AM

    Hi,

    Check the FM: 'STRING_SPLIT_AT_POSITION'.

    Regards,

    Bhaskar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2008 at 10:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2008 at 10:10 AM

    str1 = string(10).

    str2 = string+10(8).

    str3 = string+18(8).

    use offsets

    else u can use ... FM

    STRING_SPLIT_AT_POSITION

    STRING_SPLIT

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2008 at 10:11 AM

    Hi,

    ex: V1 = 28890990888899987666667889

    V2 = V1+0(10),

    V3 = V1+10(8),

    V4 = V1+18(8),

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2008 at 10:13 AM

    data : stng type string.

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

    stng = '28890990888899987666667889'.

    stng1 = stng(10).

    stng2 = stng+10(8).

    stng3 = stng+18(8).

    Add comment
    10|10000 characters needed characters exceeded