And then I hit the problem I remember having with $nlslocale.
If you ever use "%%localvariable%%%" to build data to pass back and forth, it suddenly starts getting commas in it (for values > 999).
So a piece of code which uses :-
"%%p_date[Y]%%%-%%p_date[M]%%%-%%p_date[D]%%%"
to return a date for inclusion in a sql script, suddenly returns "2,020-01-04" and screws up.
I've fixed this one by replacing with a formatted global variable, but who knows what other logic bombs are out there waiting for me.
ISTR the last time I tried $nlslocale, I accidentally put it in the IDF asn, and the whole of V9 collapsed because they were doing this to get field indirection using numbers, which is why I swore off the thing in the first place.