A few items to correct and some suggestions:
1) Your IF statement must follow the SET statement.
2) The correct method to code a date-literal requires you specify a trailing "D" character after the quoted string -- such as '01jan2009'd.
3) Suggestion: move your FORMAT statement to be in the DATA step where you are transforming the "purpose" of BDATE - from a DATETIME variable to a DATE (numeric) variable, mostly for relevance.
4) Suggestion: remove the redundant OPTIONS COMPRESS=YES; statement -- that CONFIG option had already been set with the first statement.
5) Suggestion (depending on your data-volume) either change the IF statement to a WHERE statement or also consider using a PROC FORMAT to accomplish your look-up / data-filtering processing for optimized performance.
6) Suggestion: explore the use of SAS views (or an index) for further performance optimization, where applicable.
Scott Barry
SBBWorks, Inc.