I have a string
example 1: abcdefgs:456:fdkweu/:START:41A:45583993:START:60A:6483829992:STOP:59:hagdsu2381ygu:73:
example 2:
hsdgsdgcj:64:54:adcg6edd:START:71A:274765765:START:84A:26357457454:STOP:59:2237fdguef
I want to delete any string between the 1st START and STOP strings i.e. the output should look like below. I want to delete everything that is underline above:
Output 1:
abcdefgs:456:fdkweu/:START::STOP:59:hagdsu2381ygu:73:
Output 2:
hsdgsdgcj:64:54:adcg6edd:START::STOP:59:2237fdguef
I tried the below solution of 1st identifying the string I want to remove between the first START and STOP, which I was able to identify with the code below. Next I am trying to use tranward to drop this identified string from the original column, but with no success.
My code:
data want;
data have;
length newstring $1000;
startpos = index(string,":START:");
endpos = index (string, startpos+7, endpos-(startpos+7));
drop startpos endpos;
string = tranward(string, new string, "");
run;
I am able to code for the first part and it works fine where I can identify the sub string I want to drop from the main string. However, I am not able to drop the identified string from the main string, using tranward. I am unable to query it correctly.
Please help with the red part of the code.
Thank you