IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get five days prior DATE


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Aug 24, 2009 4:21 pm
Reply with quote

What is your version/release of COBOL?

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 24, 2009 4:45 pm
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 ibmmainframes.com/viewtopic.php?t=37222&highlight=integer

and

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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 24, 2009 5:02 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Aug 26, 2009 9:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top