You should look at the setting of your YearCutOff option. Unless someone intervened, it is probably on the default install value, which I think is 1920. Using the cut off year, SAS imputes the century for two digit dates. Those prior to the year cut off are imputed to be 21st century, and those after start in the 20th century.
What this doesn't explain is why a financial (?) year value of 99 should match a year value of 7, unless the year value is simply a counter to derive a cohort for a financial model.
I think we need to see more of the code and some of the log to understand the issue better.
Not all your code is posting because of the less than signs in the text.
From the Macro Expressions documentation ( I had to substitute LT for the symbol, and add spaces arount LT).
Note: Expressions in which comparison operators surround a macro expression, as in 10 LT &X LT 20, might or might not be the equivalent of a DATA step compound expression (depending on what the expression resolves to). To be safe, write the connecting operator explicitly, as in the expression 10 LT &X AND &X LT 20.
I would go a bit further and put the spaces around the symbolic tokens, and make one other change, use 00 instead of 0 to insure 9 is greater than 0 and not 9 is greater than a space or null or something:
%if 00 LE &fyr AND &fyr LT &yr %then ...
Also, the code for last year should not work properly.
&yr is always equal to &yr, but your condition is less than, so it should always fail and never process the %then statement(s). Then, 07 is less than 20 so that should have failed as well. So where did last_year get its value of 2007 from?
Message was edited by: Chuck