View Full Version : Date duration in CL
David Abramowitz
04-08-2005, 06:13 AM
I'm not sure what your CL objectives are from this post. There are certain commands that will permit date data type differences. OPNQRYF is one of them - see example. Dave <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b2409c1/0')
Guest.Visitor
04-08-2005, 09:09 AM
Thanks for your answer, Dave. My CL-pgm looks like the code below. The problem is that the instruction %duration(&date2 - &date1) does not exist in CLP and i don't know how i can resolve this. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b2409c1/1')
Guest.Visitor
04-08-2005, 10:13 AM
You could use the CVTDATE to convert your two input dates to julian dates and determine the "duration". But you have to be careful and provide for dates that fall within different years. However using the TOFMT(*LONGJUL) may help.
Guest.Visitor
04-08-2005, 10:34 AM
You can call the CEEDAYS API. The CEEDAYS will convert a date to a lillian date, then you can add or subtract the two converted dates to get the duration.
Guest.Visitor
04-08-2005, 01:37 PM
Hi, I have a CLP that receives 2 dates as parameters and it should return a text-string under the following conditions. The dates are in yyyymmdd format. If duration between the 2 dates > 367 then text = "Report yyyymmdd1-yyyymmdd2. if duration < 10 then text = "weekly report". If duration < 32 then text = "monthly report". if duration < 93 then text = "trimestrial report". if duration < 186 then text = "Semestrial report". if duration < 367 then text = "Yearly report". Is this possible in CL or should i replace the program by an HLL-Pgm ? As i still use OPM-Cobol and not know RPGILE, i should appreciate it to receive the coding to achieve this. Thanks for any reply
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.