Hi,
well, I suspect you do not have a value of &x='first' in each of your &x variables.
You may need to determine the reference value for each of your variables.
I added such a dummy 'first' value in each of the variables in my test data and it worked, please find an example below.
data cp1;
set sashelp.class;
length Gender $5 Disease_Type $5 Disease_Status $8 Active_Therapy $5 Time 8 Event 8;
Gender=sex;
Disease_Type=ifc(sex eq 'M','One','Two');
Disease_Status=ifc(sex eq 'M','Resolved','Ongoing');
Active_Therapy=ifc(sex eq 'M','Y','N');
Time=age;
Event=mod(age,2);
*add a reference to all variables;
array vars _CHARACTER_;
do over vars;
if mod(_N_,3) eq 0 then vars='first';
end;
keep Gender Disease_Type Disease_Status Active_Therapy Time Event;
run;
... View more