There are several ways of addressing this depending on where/how you are calling your SQL Bizcomp. When an element is mapped and the reference fails, XAware returns the actual reference as a substitution failure.
The quickest solution is to write and apply a simple
Functoid that validates your mapped value - e.g. if it is not valid (i.e. StartsWith "%" and/or EndsWith "%" you could assume a substitution failure) return "0" or some default, otherwise if valid return the original value.
You could also write an Empty() or notEmpty() functoid which performs a similar check and returns "true" or "false". You could use any of these functoids in an
xa:switch/xa:case instruction to decide whether to execute the SQL Bizcomp.
If you pass
XML into your SQL Bizcomp (and then map the values from the XML instead of parameters), you can use the Bizcomp iteration behavior to control processing. For each node matched in the
xa:input instruction parameter Path reference, the Bizcomp will execute that many times; including zero executions if there is no matching input XML. (However,if the XML exists with substitution failures as values, that XML will still be passed and the Bizcomp executed).
If you post your example bizfiles, we might be able to make a more specific recommendation.