Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to get five days prior DATE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Sudhir KL

New User


Joined: 15 Feb 2008
Posts: 17
Location: Safe Planet

PostPosted: Mon Aug 24, 2009 4:09 pm    Post subject: How to get five days prior DATE
Reply with quote

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
View user's profile Send private message

Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Aug 24, 2009 4:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Aug 24, 2009 4:21 pm    Post subject: Reply to: How to get five days prior DATE
Reply with quote

What is your version/release of COBOL?

Bill
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Mon Aug 24, 2009 4:45 pm    Post subject: Reply to: How to get five days prior DATE
Reply with quote

Quote:
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


NO, it could be easily defined as the worst...
why put an unneeded db2 dependency

see http://ibmmainframes.com/viewtopic.php?t=37222&highlight=integer

and

http://ibmmainframes.com/viewtopic.php?t=29344&highlight=integer
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Mon Aug 24, 2009 5:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Sudhir KL

New User


Joined: 15 Feb 2008
Posts: 17
Location: Safe Planet

PostPosted: Wed Aug 26, 2009 9:31 pm    Post subject: Reply to: How to get five days prior DATE
Reply with quote

thank you very much. I got the integer of date and did some calculation and converted back.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 26, 2009 9:44 pm    Post subject: Reply to: How to get five days prior DATE
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us