But even if tokens are enabled, will this job do what the DBA wants it to do?
I ran an altered test scenario on my local SQL Sever. I had two steps: one to print the value of A-DBN and another to check for objects in the dbo schema newer than 90 days (I chose dbo because I don't have a maint schema).
The following messages were returned (I tried several databases including master and user databases):
Step 1 (print A-DBN)
Executed as user: NT SERVICE\SQLAgent$SQL2014. Current database name is [SQLSTATE 01000] (Message 0). The step succeeded.
Step 2 (check for objects over 90 days old and raiserror, as in the QOTD)
Executed as user: NT SERVICE\SQLAgent$SQL2014. One or more objects in the .maint schema are more than 90 days old. Review and see if they can be dropped, or moved to a different schema [SQLSTATE 01000] (Message 50000). The step succeeded.
Why was A-DBN empty? Did I mess something up or is the handsome DBA from the question going to be banging his head again once he enables tokens and this still doesn't work?