Hi, Here is the explaination of my dataset. Data contains 62 variables. One is unique key as account id and 60 variables are some monthly recovery amounts. the last variable is Total Loss. I want to know all default accounts monthly basis. For this, I created one array of recoveries which is the cumulative sum of months. I am facing problem in creating this array. data test; set recovery; array month{60} nm_1-nm_60; array recovery{60); do i=1 to 60; if _n_=1 then do; Recovery(i)=month(i); end; else do; Recovery(i)= Sum(month(i),Recovery(i-1)); end; end; run; after this I want to check the condition in do loop data test; set recovery; do i=1 to 60; If Recovery(i) < total_loss then output(i); end; run; Can you please help me with the code.
... View more