i'm going to go out on a limb and say that a SELECT WITH directive is not supported in this db as many forums state that subqueries are not even supported.
i have seen some forum posts suggest to define the subquery in a join. please see the blog post here for an example of this technique in the section 3) Using a Virtual Table Defined in a JOIN Statement
you'll probably need to peruse some ax2009 forums to find syntax that will actually work for this db. in the blog post that syntax is for sap hana. command syntax is specific to the db that you're using as you've probably already seen.