I am facing cumulative sum calculation. In my dataset, the columns to be summed are something like Cycle_1 to Cycle_65. My program works to calculate the cumulative from cycle_1 to cycle_9. However, something is wrong from cycle_10. In my previous dataset, the column VISIT is a character type . Below my program: Data Test2; SET Test1; BY ID _VISIT_; ATTRIB VISIT LABEL = "Visit" FORMAT = $50. ; ATTRIB CUMUL LABEL = "Cumulative sum by cycle" FORMAT = BEST12. ; VISIT = SUBSTR(_VISIT_,1,8) ; IF FIRST.ID THEN CUMUL = VALUE ; ELSE CUMUL + VALUE ; DROP VALUE; RUN ; When the program , run , I have an output below. So I need your help because I did not found were's the issues. Many thanks
... View more