David Gibbs (email@example.com) wrote: >Ick... I forgot to mention... I'm using ILE RPG. OK then, David. I'm still feeling my way a bit in RPG/IV, but how about this? dDateIso S D datfmt(*iso) dTodIso S T timfmt(*iso) dTstp S Z dTimeDS DS d Tod 1 14 0 d TodNum 1 6 0 d DateNum 7 14 0 c time Tod c move DateNum DateIso c move TodNum TodIso c move DateIso tstp c move TodIso tstp That should do the trick. Now, as to the juggling fields thing I was talking about before, the Grand Wazir has just realised that he didn't get it quite right. The format of the date returned by TIME is not dependent on system values as such: it's the _job's_ date format that counts. If you know your DATFMT is *YMD the above code will work. If you don't know that for sure, you will have to retrieve the date format and juggle accordingly, but this should be more elegant than in OPM. You could define other date fields in addition to DateIso, each in a different format, and use the one that fits the retrieved format. I still prefer the TIME opcode over the user date. Remember that UDATE does not change over midnight so it will not necessarily contain the current date. You could get the correct date values for century, year, month and day separately by retrieving the system values, but you still have to watch out for the possibility of the date changing between retrieves of the date and the time. HTH Dave Kahn - TCO, Tengiz, Kazakstan ========= e-mail: firstname.lastname@example.org (until September 30th) email@example.com (from October 1st) +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: firstname.lastname@example.org +---
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.