I'm perhaps over-complicating this problem, and for various reasons I'm keen to keep this in IML as it is part of an iterative process which requires matrix calculations later on. I wondered if there was some way I could use the LOC function but thinking probably not. High level description of problem I have a list of percentages. The percentages determine the rate you receive. I want to re-code the original percentages in one vector into the target rates in another vector. Detail I wish to re-code each element of Vector A into a value in Vector C. Vector B lets us determine the column of Vector C we want to return. So, any element with value less than or equal to 0.5 falls into category 1 (i.e. that is returns 0.02 from Vector C); between 0.51 and 0.55 (inclusive) would be category 2, and so on. Example So, in this example, element 1 of Vector A is 0.78 - it falls into category 7 (determined by vector B). Therefore, element 1 of the resulting vector will be 0.08 (which matches column 7 of vector C). Vector A contains the percentages which I want to re-code. M1 M2 M3 M4 0.78 0.75 0.72 0.69 Vector B contains contains the categories (these allow me to determine which column of vector C i need). LookupVector 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 Vector C contains the target rates Match50 Match55 Match60 Match65 Match70 Match75 Match80 Match85 Match90 Match95 Match100 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 The output would look like this : 0.08 0.07 0.07 0.06 I have solved this using two DO loops (see attached), but I really believe this won't be the most efficient way to do it. This will be repeated many times so removing any loops will be important. Thanks in advance for any help.
... View more