Really appreciate for the input. Since forecasted spend has to be based on actual spend. The line spend (i ) = spend (i-1) / shape_factor (i-1) * shape_factor( i ) will let spend(i) depend on spend(i-1) which further depends on spend(i-2). Therefore, I modified your suggested code by differentiating forecast spend and actual spend below. But again, since haven't assign actual spend data into an array, SAS will assume spend(i-1) is an undeclared function of i, per ballardwpointed out earlier. Plus, assigning shape factors this way might not be realistic dealing with thousands of segments/shapes later on. Thanks for the code though, I am piecing info from the forum and my research together and am sure will find the answer eventually/hopefully. %let count=60; data output; set input; array forecast_spend (60); array shape_factor(24) _temporary_ ( 0.2 0.56 0.65 0.73 0.80 0.86 0.91 0.95 0.98 1.00 1.02 1.04 1.06 1.08 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19); do i = months_since_opened to &count; forecast_spend (i ) = spend (i-1) / shape_factor (i-1) * shape_factor( i ) end; run; Log: The function spend is unknown, or cannot be accessed.
... View more