|
The %subdt BIF does not automatically adjust the size of its workfields according to the 2nd parameter. Unless explicitly defined, it uses a 10,0 decimal field which caused the %editc to give unexpected results.
I bet it's actually a "10I 0" field (in other words, a binary integer, not a decimal field.)
It would have been a bonus if the compiler automatically used a 2,0 workfield when processing *M and *D values, but I guess you can't have everything!
You can control that using the %dec() BIF if you want to. For example: w_Char2 = %editc( %dec( %subdt(w_Date:*months) :2:0) :'X');Though, in my opinion, the way you did it is easier to read. I don't like nesting BIFs, it gets ugly quick.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.