The only sure method I found is to query the @@nodeid global variable.
This nodeid value is different for each of the ASE databases.
Therefore if you’re logged onto the primary node, you will see a different ID.
I found this to be exceptionally useful when logging into a database as sapsso, since this user is redirected to the primary database in a HADR setup.
UPDATE: July 2016, I've since found this little gem: