Hi mkeintz,
I tried running the code but got many errors. I just changed id to cusip and x to prc
array history {&lb:&ub} _temporary_;
- -
22 200
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
a numeric constant, a datetime constant, a missing value, (, -, :, ;, _ALL_,
_CHARACTER_, _CHAR_, _NUMERIC_.
ERROR 200-322: The symbol is not recognized and will be ignored.
411! array history {&lb:&ub} _temporary_;
-
22
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,
a datetime constant, a missing value, iterator, (, ), ','.
412
413 if first.cusip then call missing(of history{*});
ERROR: Undeclared array referenced: history.
ERROR: The ARRAYNAME[*] specification requires an array.
414
415 history{date}=prc;
ERROR: Undeclared array referenced: history.
ERROR: Variable history has not been declared as an array.
416
417 if prc^=. then do;
418 _rolling_n+ 1;
419 _rolling_sum+ x;
420 _rolling_ss+ x**2;
421 end;
422
423 _most_recent_drop_date=intnx('year',date,-4,'sameday');
424 _prior_most_recent_dd=lag(_most_recent_drop_date)+1;
425
426 if first.cusip=0 then do _drop_date=_prior_most_recent_dd+1 to _most_recent_drop_date;
427 if history{_drop_date} ^= . then do;
ERROR: Undeclared array referenced: history.
ERROR: Variable history has not been declared as an array.
428 _rolling_n+ (-1);
429 _rolling_sum+ (-history{_drop_date});
ERROR: Undeclared array referenced: history.
ERROR: Variable history has not been declared as an array.
430 _rolling_ss+ (-history{_drop_date}**2);
ERROR: Undeclared array referenced: history.
ERROR: Variable history has not been declared as an array.
431 end;
432 end;
... View more