So the OP's question is how to access an element of a so-called macro array, using an index. Here is a way. HTH. %let btype_1 = O+; %let btype_2 = O-; %let btype_3 = A+; %let btype_4 = A-; %let btype_5 = AB+; %let btype_6 = AB-; %let btype_7 = B+; %let btype_8 = B-; %macro btype(idx); %if &idx < 1 or 8 < &idx %then %return; %*;&&btype_&idx %mend btype; %*-- check --*; %put blood type 1 = %btype(1); %put blood type 3 = %btype(3); %*-- on log blood type 1 = O+ blood type 3 = A+ --*;
... View more