I am new to programming and I don't really understand Arrays. I am trying to calculate the day on day variance of the below dataset Country Segment Mar_30 Apr_2 Apr_3 Apr_4 Singapore Corp 126,196 126,196 126,196 126,196 malaysia Ret 70,521,201 70,562,347 70,455,005 70,556,299 so the expected output is to have the same number of records but have day on day variance i.e for malaysia the Apr2 balance would be Apr2 balance minus Mar 30 balance , something like this, Country Segment Apr_2 Apr_3 Apr_4 Singapore Corp - - - malaysia Ret 41,145 (107,342) 101,294 This is the code I am tusing but not getting expected output.I am using base SAS 9.3 data check_op; set check_op_e; array nums[*] _numeric_; array aday[*] _numeric_; do i=2 to dim(nums); aday(i)=nums(i)-nums(i-1); end; run; I hope someone can help me on this problem. Thanks in advance.
... View more