Nope its just that i have variables like Diag1, Diag2,Diag2 and in my loop i might get data for Diag1 or sometimes Diag1, Diag2 so i must assigned values into them dynamically rather than using separate if conditions like,

if (diagCounter = 2){
    set DIAGNOSIS2 = DIAGS
    }elseif (diagCounter = 3){
    set DIAGNOSIS3 = DIAGS
    }

Anyways thanks for your answer.