Closed bobcozzi closed 2 years ago
I agree it would improve performance, but it feels like a bit of a micro-optimisation 🙂
I'd sooner strip the whole procedure out in favour of the new %upper
BIF, to be honest.
Right %UPPER if a better option and scan/replace is your friend in this case. But that limits backwards compatibility. Considering the number of times toUpperCase is called, it should make a difference. But yes, %UPPER is good too.
Since toUpperCase is used so frequently adding RTNPARM to the DCL-PI statement would improve performance. The EXEC SQL function is fine, but QlgConvertCase API would also help but isn't strictly what I'm suggesting here. `dcl-proc toUpperCase export;
dcl-pi *n varchar(512) RTNPARM; lowerString varchar(512) const; end-pi; dcl-s upperString varchar(512); exec sql SET :upperString = UPPER(:lowerString); return upperString; end-proc;`