Using RUNSQLSTM to create a UDF works great.
However, I wanted to port it to one of the V5R4M0 systems we have.
So I issued: RUNSQLSTM CVTDATE TGTRLS(V5R4M0)
It failed with classic amateur CL programming errors. Meaning who ever wrote the command was a bone head.
If I specify TGTRLS(V7R1M0) or TGTRLS(*CURRENT) it works, but anything else, fails.
There is a PTF to fix this issue, but we have that installed and still get that failure.