|
----- Original Message ----- From: "Ken Sims" <ken@ke9nr.org> To: <midrange-l@midrange.com> Sent: Thursday, December 06, 2001 8:35 PM Subject: Re: Month End CL > Hi Chris - > > >I am working on a small CL program and I am wondering what the best way to > >determine the last day of the month is. I'm not a programmer, but this is > >just a small project I'm working on. > > The easiest way would be in RPG IV, which can handle this kind of thing easily. > > However if you must do it in CL, use the CVTDAT command. Try it with the > month and year and day 31. Monitor for message CPF0555. If you receive > that message, try it again with day 30, then 29, then 28. When you don't > get message CPF0555, then the date conversion was successful and so the > date was valid. Or a slightly more efficient way would be to have a table of the month ends (12) of them, and then plug the value for Feb 29 in years evenly divisible by 4 unless they are century years (00) that are evenly divisible by 400. Unless you actually do mean day - like mon, tue, web, thur, fri.
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.