11-29-2007 12:32 PM
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
11-29-2007 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
11-29-2007 12:38 PM
Hi..
Try this code:
<b>Replace all occurrences of 'SC' with SPACE IN FIELD1.
CONDENSE FIELD1 NO-GAPS.
</b>
11-29-2007 12:38 PM
hi,
you might use regex or replace,
write the statements in your code and press "F1"
11-29-2007 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
11-30-2007 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