Skip to Content
author's profile photo Former Member
Former Member

String operations

Hi friends,

I have a small requirement,

I have a string length of 30 char. i should split that string in such a way that first 18 char should be stored in one variable and remaining 12 char in another variable.

Plz help me out.

bye.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 10:51 AM

    move string+0(18) to str1.

    move strinf+18(12) to str2.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 10:52 AM

    Hi,

    data : char(18) typec ,

    char1(12) type c,

    variable(30) type c. " in which you have the value

    now

    char = variable+0(18).

    char1 = variable+18(12).

    regards,

    Venkatesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:13 AM

    Thanks it worked.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:16 AM

    hi kamal....

    try this program.....

    DATA : str(30) TYPE c VALUE 'HARIMANJESH.ASHWATHM',

    str1(18) TYPE c,

    str2(12) TYPE c.

    START-OF-SELECTION.

    str1 = str+0(18). " Instead of this statement, u can also use <b>MOVE</b> Command.

    str2 = str+18(2).

    WRITE : / str1 ,

    / str2.

    Reward me if useful.

    Harimanjesh AN

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.