Hello, I am a new SAS user, and this is my first time posting a question. I did try to look for existing answers but I have not seen a similar question being asked. So maybe it's either not feasible or laughably simple. So please bare with me. I have a table with a date variable, a "RF" (stands for "risk free") variable, and 20+ variables with these names: small_lobm, me1_bm2, ,me1_bm3, me1_bm4, small_hibm, me2_bm1, me2_bm2, ,me2_bm3, me2_bm4, me2_bm5, me3_bm1, me3_bm2, ,me3_bm3, me3_bm4, me3_bm5, me4_bm1, me4_bm2, ,me4_bm3, me4_bm4, me4_bm5, big_lobm, me5_bm2, ,me5_bm3, me5_bm4, big_hibm (I break them into 5 lines just for the ease of reading so you can see how the names were constructed). So what I am trying to do is, for each of these 20+ variables, create a new column that is equal to variable - RF. Something like this: Data want;
set have;
small_lobmx = small_lobm - RF;
run; I try to see if it's possible to not have to do that same thing 20+ times for each of them. And I don't need to keep the old 20+ ones afterward. I'm using AS 9.4. Please help and thank you very much!
... View more