I have a data set with a bunch of IDs as string variable like eg.below. I want to delete all the characters from "(" and include only the numbers before "(" for each ID. Any help with SAS code is much appreciated.
If your pattern is not so consistent with some records not having the special character like the 3rd in the modified sample, the following should work
data have; input id $20.; cards; 48 (500_82) 49 (501_82) 40 ; data want; set have; if find(id,'(')>0 then want=substr(id,1,find(id,'(')-1); else want=id; run;
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.