Hello, I am pretty new to SAS and I was wondering if someone could help me out with this. Suppose I have the following data set: ID Var1 Var2 Var3 Var4 1 1 1 1 1 2 1 0 1 0 3 0 1 0 0 4 0 0 0 1 I need to be able to count the number of ones in each row before there is a zero and once there is a zero the count stops. I need to be able to do this starting from var1 going to var4, and also starting from var2 going to var4, and also from var3 to var4. My first output variable should look like this: ID count_A 1 4 2 1 3 0 4 0 The second output variable should look like this: ID count_B 1 3 2 0 3 1 4 0 The third output variable should look like this: ID count_C 1 2 2 1 3 0 4 0 Thanks
... View more