I have a string
:20:catclimbedthetree:STOP:dogranaftercat:STOP:catwasinthehouse:-
I want to delete everything after the 2nd :START: and also delete :START: i.e. the desired output is as below, what should I do? I used index function and substr but it is truncating all the characters after the first :START:. Please help.
:20:catclimbedthetree:START:dogranaftercat
Thank you
You only have one START in your example not two.
Do you mean STOP?
Your description of the problem and example do not align.
@SAS_New_User1 wrote:
I have a string
:20:catclimbedthetree:STOP:dogranaftercat:STOP:catwasinthehouse:-
I want to delete everything after the 2nd :START: and also delete :START: i.e. the desired output is as below, what should I do? I used index function and substr but it is truncating all the characters after the first :START:. Please help.
:20:catclimbedthetree:START:dogranaftercat
Thank you
The pattern searches and selections with Substr for the specified positions are very similar to some of your prior questions.
What have you tried so far?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.