|
" Hello Scott, Thanks for that. You did understand the question correctly. As a result of your successful experiment I did some research. The VRM310 RPG IV reference Manual for ADDDUR states: "If the result field is a time field, the result must always be a valid Time, (if the calculated result is >= 24:00:00, subtract 24 hours or a multiple of 24 hours until the time is valid). If the result is a Timestamp field, and the *MS or time portion is operated on, the date must be adjusted, each time the 24:00:00 boundary is crossed." This statement is what I recalled. It always struck me as counter-intuitive that timestamp would be treated as a compound data type and the date and time portions operated on seperately thus forcing the programmer to compensate. I always thought that timestamp should be treated as single data type and rolling the microseconds should affect the time portion and rolling the time portion should affect the date portion. However, by VRM320 it appears that this anomaly has been corrected. The VRM320 RPG IV Reference Manual has rewritten this section as: "If the result field is a time field, the result will always be a valid Time. For example adding 59 minutes to 23:59:59 would give 24:58:59. Since this time is not valid, the compiler adjusts it to 00:58:59." The implication here is that the RPG compiler is handling this but I would expect the system (as in MI) time operations to handle it. More reading in the MI Reference for me. Perhaps Barbara or Hans can comment on where the correction actually happens. There is no mention of what happens to timestamp fields when the time duration is greater than 24 hours but the experimental evidence shows that the date is rolled correctly when positive or negative time durations are added to a timestamp data type. There may have been something about this change in the Memo to Users for VRM320 but that is so old now I don't care. It is enough to know that timestamp behaves the way one would expect. Regards, Simon Coulter. «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» «» FlyByNight Software AS/400 Technical Specialists «» «» Eclipse the competition - run your business on an IBM AS/400. «» «» «» «» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ «» «» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / «» «» X «» «» ASCII Ribbon campaign against HTML E-Mail / \ «» «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.