Good day to everyone. Got some issue with...idk even what type of problem is...macro, arrays or even do loop. %macro name(indata=, some_num=); data &indata_new; set &indata; array var_x_arr [*] var_x1 - var_x&some_num.; array var_y_arr [*] var1_y - var&some_num._y; do j = 1 to dim(var_x_arr); if var_y_arr (j) = "Y" then do; col4 = var_x_arr(j); end; end; run; %mend; %name(indata=A, some_num=2); %name(indata=B, some_num=5); So, the essence of my question is that I have 2 types of variables that are always together (var_x1 and var1_y) In dataset A there are only 2 of them (that is, var_x1 var1_y and var_x2 var2_y) In dataset B there are only 5 of them (that is, var_x1 - var_x5 and, accordingly, var1_y - var5_y) var_x1 accepts text values var2_y accepts either 'Y' or 'N' But it gives an error "ERROR: Missing numeric suffix on a numbered variable list (var_x1 - var_x2) already triing " array var_x_arr [&some_num.] var_x1 - var_x&some_num.; array var_y_arr [&some_num.] var1_y - var&some_num._y; do j = 1 to &some_num.; " and different variants writing with these syntax( with $ and without, " to dim()" and so on) My version is 9.4
... View more