So I have this dataset that has different products and they each have different release month of when they go on the market. because my original dataset starts at J05 while some products release later (product5 releases in F05)
I want to make the data set so instead of the columns going JAN05 F05...
I want it to show 1st month of sales, 2nd month of sales for each product.
data test1 (drop = J05 F05 M05 A05 i j) ;
set test ;
array inweek J05 F05 M05 A05 ;
array outweek wk1 - wk4;
do i = 1 to dim(inweek);
if inweek(i) ne 0 then do j = 1 to dim(inweek);
outweek(j) = inweek(i);
i + 1;
sumweek = sum(wk1-wk4);
if i > dim(inweek) then return;
You might do it cleaner, but without it the loop was executing a reference to the array at a limit + 1 point and getting an error. This just forces the loop to end since you are not actually executing the upper end of the outer loop.