This "solution" demonstrates how to avoid loops:
options missing = '#';
data want;
set have;
length value $ 10 all $ 200 p baseline 8;
array one lle9-lle14;
array two R9AGEY_B R10AGEY_B R11AGEY_B R12AGEY_B R13AGEY_B R14AGEY_B;
value = put(coalesce(of one[*]), best.);
all = catx(' ', of one[*]);
p = findw(all, strip(value), ' ', 'e');
baseline = two[p];
*drop value all p;
run;
options missing = '.';
While coalesce still sees "missing", catx keeps missing values and displays them as #, so findw returns the number of the "word" matching the first non-missing value, which is the value of array two becoming the value of baseline.
In real-life i would use the second suggestion posted by @ballardw
... View more