It appears that WITH is supported only in Sybase SQL Anywhere: http://dcx.sybase.com/1100/en/dbusage_en11/commontblexpr-s-5414852.html
...but not in Sybase ASE :(
Can someone suggest if there is a equivalent construct in Sybase ASE? There are other ways to implement stuff instead of using WITH, but we are planning to repurpose some of our dynamically generated SQLs to run in Sybase and support for WITH or something close to that syntax is very much desired.