I agree that there seems to be a problem with calling APPLY with character arguments. There's no need to recode anything: just use a loop to call the scalar function that you've already written. It's not as general, but it should work adequately. start MyApply(age_array,text_array); temp = J(nrow(age_array),1); do i = 1 to nrow(age_array); age = age_array; text = strip(text_array); temp = test(age, text); end; return(temp); finish; age_vect = {1,2,3,4,5}; text_vect = {YES, NO, NO, NO, YES}; r = MyApply(age_vect, text_vect); print r;
... View more