Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

very very urgent

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

varma_narayana
Active Contributor
0 Kudos

Hi..

Try this code:

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

CONDENSE FIELD1 NO-GAPS.

</b>

Former Member
0 Kudos

hi,

you might use regex or replace,

write the statements in your code and press "F1"

Former Member
0 Kudos

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

Former Member
0 Kudos

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