|
>When I try to set Date format to *DMY in DDS using following syntax and run >my program, > >A MDATE L B 4 40DATFMT(*DMY) > >The following error occurs. > "The year portion of a Date or Timestamp value is not in the correct range >" > >If I use any other date format besides *DMY, then it works fine. >I am using Client Access on my Laptop having Windows XP, and my system date >format in Regional Settings is set to : dd/mm/yyyy. > >In Source, I have defined the field as under:- > >D MDATE S 10D >C EXFMT RECORD1 > >Further, how can I set the date format to 4-Digit Year like (DD/MM/YYYY) >and pass the current date to the MDATE. Luqman firstly just a minor point, but there is no need to (re)define MDATE in your D-specs. I do not use L type fields on display files so am not sure of your exact problem. The way I tend to do dates is: A MDATE 6Y 0B 8 67 A EDTWRD('0 / / ') A EDTMSK(' & & ') and then in RPG D WK1isoDate s d D WK1todayCYMD s 7 0 D*WK1todayDMY s 6 0 C Move *date WK1isoDate C *cymd Move WK1isoDate WK1todayCYMD C* *dmy Move WK1isoDate WK1todayDMY C *dmy Move WK1isoDate MDATE HTH Mike ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.F-Secure.com/ This communication and the information it contains: - (a) Is intended for the person(s) or organisation(s) named above and for no other person(s) or organisation(s). Access to this mail by anyone else is unauthorised. (b) Is confidential, and may be legally privileged or otherwise protected in law. Unauthorised use, circulation, copying or disclosure of any part of this communication may be unlawful. (c) May be susceptible to interference, and should not be assumed that it has come in its original form and/or from the stated sender or PinkRoccade UK accepts no responsibility for information, errors or omissions in this e-mail or use or misuse thereof or any act done or omitted to be done in connection with this communication. If you are not the intended recipient, please inform postmaster@xxxxxxxxxxxxxxxxx immediately and delete it and all copies from your system.
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.