02-14-2017 11:36 PM - edited 02-14-2017 11:36 PM
I have a variable of text "name" with some record follow the rule.
As you see, the records are
I want all record with the lg at the end to be delete anything after the "_lg" including the "_lg" itself.
it only appear at the end if there is any "_lg".
So the output should be
Any help is very much appreciated.
input name $;
02-15-2017 05:40 AM
data have; input name $20.; want=prxchange('s/\_lg\d+\s*$//i',1,name); datalines; value123 value value_lg3 value_t1_lg6 value_lg12 value_3_ab_lg3 ; run; proc print;run;
Need further help from the community? Please ask a new question.