|
Lois wrote: >Hi all: > >Can anyone tell me why this will not work. #tims is defined as 12 alpha. > > c eval #tims = %triml(%editw(%subdt > 19.00c (%timestamp:*h):'0 '))+ > c %triml(%editw(%subdt > 21.00c (%timestamp:*mn):'0 '))+ > c %triml(%editw(%subdt > 23.00c (%timestamp:*s):'0 '))+ > c %triml(%editw(%subdt > 25.00c (%timestamp:*ms):'0 ')) > >1900 The edit word has 3 replaceable characters but 10 are > needed. >2100 The edit word has 3 replaceable characters but 10 are > needed. >2300 The edit word has 3 replaceable characters but 10 are > needed. >2500 The edit word has 3 replaceable characters but 10 are > needed. The built-in function %SUBDT returns an I(10) value (like most other BIF's that return numeric values). (Or even I(20) in some situations.) Code %DEC(...:3:0) around the call to %SUBDT and then it should compile. Also note that %SUBDT(...:*MS) will (normally) return a 6 digit value, and so you need more digit replacements. For what you are trying to do, I think I'd prefer taking a different approach. I think I'd first do something like: CHAR = %SUBST(%CHAR(TIMESTAMP):12); and then %SCAN for the periods and %REPLACE them with ''. Or, instead of using %EDITW, you could use %EDITC(...:'X') and %SUBST the rightmost characters of the result. Cheers! Hans Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
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.