View previous topic :: View next topic
|
Author |
Message |
Sudhir KL
New User
Joined: 15 Feb 2008 Posts: 17 Location: Safe Planet
|
|
|
|
I have a repoting job that runs on fridays. The program picks the date from system. The date printed in the report is of Friday.
But I want Monday's date to be printed in the report. So, how do I get 5 days prior date? Is there any function . Thank you |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
You can add the dates using DB2 operation and then print, COBOL does not support any date calculation or your shop may have some routine that does such operation the best way is to do this is using DB2
The preceeding info is incorrrect. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
What is your version/release of COBOL?
Bill |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
COBOL does not support any date calculation |
Actually, recent versions of COBOL do with the FUNCTION capability -- date values can be converted to an integer number of days, values added or subtracted, and converted back. Not to mention COBOL supports use of the LE date functions as well -- so there's at least two different ways now to do date calculations in COBOL. |
|
Back to top |
|
|
Sudhir KL
New User
Joined: 15 Feb 2008 Posts: 17 Location: Safe Planet
|
|
|
|
thank you very much. I got the integer of date and did some calculation and converted back. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thanks for letting us know
d |
|
Back to top |
|
|
|