Skip to Content
avatar image
Former Member

split or offset

HI experts,

I have a string with 150 lenth ,i ahve to split or offset this string into two parts, with 75, 75 lenths,

please give me an idia on this.

thanks in advance.

Radhakrishna

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Sep 02, 2008 at 10:38 AM

    Hi RadhaKrishna,

    Use Offset.

    Thanks & Regards,

    M.Ramana Murthy

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:39 AM

    Hi,

    w_var1 = w_var+0(75).
    w_var2 = w_var+75(75).

    Regards

    Adil

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:40 AM

    hii

    you can use offset here.like

    w_final = wa_str1+0(75).

    w_final1 = wa_str1+75(75).

    regards

    twinkal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:41 AM

    You can use the offset in a similar way it is used for char fields.

    move text+0(75) to text1.

    move text+75(75) to text2.

    I think it will solve ur problem .

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 02, 2008 at 10:41 AM

    Use Offset, as it allows u to split at particular character length.

    where as split , splits the word at any occurance of a character which u specify in syntax.

    So use Offset.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:41 AM

    USE OFFSET.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:41 AM

    Hi,

    try this....

    data : str1(75) type c,

    str2(75) type c,

    str(150) type c.

    str1 = str+(75).

    str2 = str+76(75).

    write : str1,str2.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:44 AM

    Hi Radhakrishna,

    Use this:

    data: var1 type string,

    var2 type string.

    var1 = str+0(75).

    var2 = str+75(75).

    Hope this will help.

    Regards,

    Nitin.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:51 AM

    Hi,

    Offset is effective then split.Use offset.

    Thanks,

    radha.

    Add comment
    10|10000 characters needed characters exceeded