Once again, I received exactly the help I needed (thus, yes, Patrick, above gives me what I am after). Thank you very much, both of you! @LinusH wrote: How will you use this new id? Why can't you use date directly? If the data is sorted by date, use a data step, BY date. Then increase your id +1 whenever first.date is true. I want to use this new ID for a "expanding" regression I do have to run. My sample is to be divided into two parts - an "in-sample" part, where I get parameter-estimates and an "out-of-sample" part, where I do apply the parameter-estimates based on the prior information in such a kind, that I use them to obtain an estimate for the next data point (e.g. from January 1970 until December 1998, I run the regression each month, of ret_realzd on estor_ret, with "returns_realized" := average realized returns and "estor_ret" := average estimator for returns; then, in January 1999, I multiply my estimated slope with the then-prevailing estor_ret, add the intercept and look how well I approximate the realized return, by considering the “error”); Then, for the next set of regressions, the period of estimation prolongs by one month, which is to say, that I run the regression from January 1970 up to January 1999; then, I investigate, with the same procedure, how well I can approximate the realized return as of February 1999. I am considering to implement this procedure with a DO-Loop; From t=70 (e.g., end of first insample-period) to T=130 (total sample-end); with every increment, the data-set used for regression "grows" by one step. So, for me, as someone without any SAS-experience, it is very convenient to have a date_id; I consider to use this in correspondence with my planned DO-loop.
... View more