01-11-2013 12:54 AM
My code is
if nobs=1 then do;
Where my data1 datset contains a column nobs like below
and i want result like
nobs bal val
1 2 3
2 3 5
3 5 8
the code should produce the cumulative values ,but i am getting the missing value when i run the above code
can anyone let me know is there any other way to do or y is this failing?
01-11-2013 09:38 AM
I don't understand the result that you are trying to get, but there are several obvious problems that will yield missing data:
1) you need to read about the RETAIN statement for DATA step accumulation.
2) nobs never takes on the value '1' so the first DO is never executed.
3) bal and val are not in the input data set, so they start as missings.