thank you so much for your input. it opened my door to the new world of regex, never knew it before!
It is depended on your criteria of Keyword.
data have;
input var $50.;
cards;
1545253657356_EI_1_15_CUP_A
1545253657356_EI_1_15_MUG_A
1545265347356_EI_1_15_BOWL_A
1545T432657356_EI_1_15_CUP_B
15452657356_EI_1_15_MUG_B
1545265237356_EI_1_15_BOWL_B
;
data want;
set have;
key=substr(var,findc(var,,'db')+2);
run;
modifier 'db' means :
'd' only search 0-9 number,
'b' search number from RIGHT .
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.