|
This problem was our first Service program or programs I guess We made up several functions to handle the conversions eval DATESTR = FMTMDYYYY(DATE) * mm/dd/yyyy returned N/A returned if LOVAL Month 2 M returned if HIVAL or whatever eval DATESTR = FMTMDY(DATE) * mm/dd/yy returned N/A if LOVAL M 2 M if HIVAL ErrorL if before date window ErrorH if after Date window. etc etc etc Then output date. in your prototype FMTMDYYYY you specify that it will take a date type as a paramter and return a 10 char string You then code any special handling you need in the function. Call the function every time you want to output a date and you will have a consistent interface across all your software. And it will be very easy to update in the future The only thing I haven't been able to figure out is how to put the function call on a O spec so you don't need an extra variable. Others on this list showed me how to setup the service module and I am very thankful to them. Joe Giusto wrote: > > O.K. Now that we have true date fields and have begun using them in our > shop, we have come across an interesting problem. > > In the old way, when printing dates which had not been entered yet, nothing > shows up because of zero suppression on the Y edit code. > > Now the absence of a date is stored as 0001-01-01 and that's what prints in > place of what used to be nothing (or blank). It is confusing to the users > and every time someone new sees it we have to explain it again. > > I have begun testing date fields to be printed and using indicators (yuck) > to condition the field to print or not print. > > There's got to be a better way. Any suggestions would be appreciated. > > Thank you, > +--- | 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.