Finally, tracked it down to the combination of two issues:
1. SET STATEMENT ... FOR ... did not copy MEMALLOC'ed variables correctly
2. When MEMALLOC'ed variables are copied by SET STATEMENT ... FOR ... , audit log still needs to access original session values
Finally, tracked it down to the combination of two issues:
1. SET STATEMENT ... FOR ... did not copy MEMALLOC'ed variables correctly
2. When MEMALLOC'ed variables are copied by SET STATEMENT ... FOR ... , audit log still needs to access original session values