Hi @Tom, sorry about not being clear. Bunch of if statements with sep will help, but that's the purpose of creating this macro as i'm unaware of the what'll come next(instaed of 0 ,1 ,3 ) may be 1,2,4). Well, thanks for recognizing the do loop. As i'm not clear, let me clear that macro vars (s0,s1,s3) contains the individual category Counts from 3 diff products. i have to use them in a dataset named Surv where their child products are present in a column named Sep. so next to each child product their parent category counts must come.lets say if the child product(sep) is 0 then total( a new column) should get the value S0, similarly for child sep=1 then parent S1 value should be in total.Minima and maxima values created for the each of their use in loop as i dont want any other observation except the ones are in out_surv which may create problems such as after 0,1, i dont want 2 to come, need 3 to enter in to the loop. My trap point is while the loop is running from minima to maxima it should smoothly assign the value irrespective of the inputs.
... View more