Yes, sure. The only change I made to the code was in the below section: data calcs; merge stocks myNewData; by stock; array pct(*) perc:; do i=2 to dim(pct); if pct(i-1) <=open <=pct(i) then * on the line below I changed from index = i-1 to index = i-2 otherwise the percentiles were shifted by 1;; index=i-2; end; drop perc:; run; Apart of one line, everything else I used as is.
... View more