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

very very urgent

I hav two fields like that for example : field1 = 1234SC5678

field2 = 12345678SC.

the above two fields contains the word 'SC' or not . I need to check and if it contains i need to delete the particular word ;

The output should be : filed1 = 12345678

field2 = 12345678

Please let me know with syntax its urgent

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 Nov 29, 2007 at 12:35 PM

    Hi,

    Check the below code....

    IF field1 CS 'SC'.

    Replace all occurances of 'SC' with space in field1.

    Condense field1.

    write:field1.

    ENDIF.

    Same code for field2 also.

    Cheers,

    Bujji

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 29, 2007 at 12:38 PM

    Hi..

    Try this code:

    <b>Replace all occurrences of 'SC' with SPACE IN FIELD1.

    CONDENSE FIELD1 NO-GAPS.

    </b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 12:38 PM

    hi,

    you might use regex or replace,

    write the statements in your code and press "F1"

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 12:44 PM

    hi

    Try following code

    IF FILED1 CS 'SC' AND FILED2 CS 'SC' .

    REPLACE ALL OCCURANCES OF 'SC' WITH '' IN FIELD1.

    REPLACE ALL OCCURANCES OF 'SC' WITH '' IN FIELD2.

    ENDIF.

    L.Velu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 12:21 PM

    Hi Ramesh,

    The above solutions didn't work here. If you still need an answer try this code:

    REPLACE 'SC' WITH SPACE INTO field1.
    CONDENSE field1 NO-GAPS.

    If there is only one occurence of SC in the field this code will work fine.

    Regards,

    Charles

    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.