Alan,
And I don't believe (PLEASE CORRECT ME IF I'M WRONG) I can code " ColDta
= %Editc(%Dec(%Trim(ColDta):VARIABLE_WIDTH:VARIABLE_DECPOS):'X')".
What I'd suggest is you move the "editing" to a subprocedure where you can
hide the complexity. That way your inline code stays cleaner and more
readable (assuming a properly named procedure). Pass the desired length and
decimals to the subprocedure, and your inline code should be readable.
Then do whatever you have to in the procedure, and comment it as necessary
so the next guy can follow it. But at least the ugly code will be
localized.
One thing the procedure could do is call QECCVTEC to create an "edit mask"
using a passed in length, decimals, edit code, etc. Then that edit mask
(which you can re-use) can be passed to QECDT to perform the actual editing
of the field. But those APIs may make more sense if you needed fancier
editing with thousand separators, currency symbols, etc.
To just pad with zeros, it may be easier for the next guy to follow some
comments with zero padding then the edit APIs.
Just my .02,
Doug