Dear Madam/Sir, I would like to construct annual buy and hold returns in each fiscal year (eleven month ahead of closemonth and closemonth) using monthly return files and try an example code in this forum. I see the following error message. Any help will be highly appreciated. Thanks. Joon1. data c4; set c3; by permno; if _n_=1 then do until; ERROR 22-322: Syntax error, expecting one of the following: (, =. ERROR 76-322: Syntax error, statement will be ignored. array {1979:2019,1:12} _temporary_ ; ERROR: Undeclared array referenced: array. ERROR 22-322: Syntax error, expecting one of the following: <, <=, =, >, >=, EQ, GE, GT, LE, LT, NE, NG, NL, ^=, ~=. ERROR 76-322: Syntax error, statement will be ignored. array logplusone {12} _temporary_; y=year(date); m=month(date); logplusone{m}=log(1+ret); if closemonth^=.; if n(of logplusone{*})=12 then annualbhr=exp(sum(of logplusone{*})); run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.C4 may be incomplete. When this step was stopped there were 0 observations and 34 variables. The data form is below. 1 10001 19900131 . -0.0185 2 10001 19900228 . -0.0063 3 10001 19900330 . 0.01266 4 10001 19900430 . 0 5 10001 19900531 . -0.0127 6 10001 19900629 . 0.0141 7 10001 19900731 . 0.02564 8 10001 19900831 . -0.05 9 10001 19900928 . 0.04079 10 10001 19901031 . -0.0128 11 10001 19901130 . 0 12 10001 19901231 12 0.0013 permno date closemonth ret
... View more