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

To use split statment

Hi ,

I want to split the variable var into two variables at var1 and var2 .

I want to split var at the second place .

how should i do it?

Regards,

Harshit Rungta

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2009 at 08:40 AM
    data: var  type c length 6 value '1ABCDE",
    var1 type c length 1,
    var2 type c length 5.
    
    var1 = var(1).
    var2 = var+1.
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 27, 2009 at 08:40 AM

    give an F1 on SPLIT statement and chk.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2009 at 08:42 AM

    The command is SPLIT VAR AT DELIMITER INTO VAR1 VAR2.

    If you need to split at the second occurrence of DELIMITER then:

    SPLIT VAR AT DELIMITER INTO TEMP1 TEMP2 VAR2.

    CONCATENATE TEMP1 TEMP2 INTO VAR1.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2009 at 08:44 AM

    Hi,

    Try this .

    data : word(12), w1(10),w2(10).

    word = 'WE CAN SPLIT'.

    SPLIT word+1(11) at space into w1 w2.

    write : / w1.

    write: / w2.

    Hope this one help you

    Regards,

    Smart

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2009 at 08:51 AM

    This is sample one

    data:var(10) VALUE 'ab cde',var1(10),var2(10).

    split var at space into var1 var2.

    write : / , var2,

    var1.

    Output:

    Var2 -->cde

    Var1 -->ab

    Please selct split and press f1 and check it.

    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.