as you can maybe guess from the title I'm a little bit lost and don't really know what to search for so here it goes:

I have a STP which takes as one of its arguments a on-condition. That condition can be freely entered by the user.

And a simple condition, e.g. a.key_value eq b.key_value, works perfectly fine. The problem arises when I want to a join like, e.g. a.key_value eq b.key_value and b.birthday eq '07FEB2018'd, I get the following error-message:

Are you working on some jail time and a big fat liability suit? Because that's what's going to happen as soon as a user injects code that deletes all your tables or enters fraudulent data into a critical dataset.

NEVER, EVER LET USERS ENTER CODE INTO A PROCESS THAT DOES NOT RUN UNDER THEIR OWN USERID!!!

The _ character was originally underneath a position in the code where SAS determined the error.

Also post the entire proc or data step generating the error. Sometimes the actual cause is something earlier in the code that wasn't ended correctly but the error isn't triggered until later in the code.

Since the message says expecting values like BTRIM, CALCULATED and such I suspect that there is something else going on. I might guess that for some reason the whole macro variable is not being considered as a join condition but just some string not resolving. You might mention HOW the users set that and which interface, Web Report Studio or something else as that is likely doing something to the entered values.