I see no response to this, so let me guess:
SAS derives code to pass to db2 from the syntax you offer.
Where you offer a number SAS can make no assumptions about your expectations.
Where you offer a "date constant" you have provided guidance, and SAS should be able to convert that constant into a date constant in the standards of db2.
SO:
to achieve this arithmetic (date - 365 ), while continuing to indicate that the result is a date and not just a number, perform the calculation in the macro environment, returning the result as a date constant. That is just what the %SYSFUNC() seems designed to do ... [pre]WHERE DB2DATE = '07NOV2009'd - 365;[/pre]might be more effective if presented as[pre]WHERE DB2DATE = "%sysfunc( intnx( day, "07NOV2009"d, -365 ), date9 )"d ;[/pre]
hope this actually does what is wanted, but I'm not in a position to test it.
PeterC