I got it to work just now using bind variables instead of substitution variables and putting the % as part of the variable value.