Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2504
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: 10327
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: 8165
Location: East Dubuque, Illinois, USA

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 Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us