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 calculate the date of current date-1 month?

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

New User


Joined: 21 Sep 2007
Posts: 35
Location: kolkata

PostPosted: Thu Mar 19, 2009 11:59 pm    Post subject: how to calculate the date of current date-1 month?
Reply with quote

can anyone tell me how to calculate the date of 1 months back in cobol from current date.
example:
suppose i have a field current-date in my input file.i have to change this date to 1 month previous date and write that date into a file.how can i do that?

thanks,
saubhik
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 20, 2009 12:21 am    Post subject:
Reply with quote

A quick COBOL forum search of "current date minus month" resulted in Date that will be 6 months less than the current date.....
Back to top
View user's profile Send private message
saubhik

New User


Joined: 21 Sep 2007
Posts: 35
Location: kolkata

PostPosted: Fri Mar 20, 2009 12:32 am    Post subject:
Reply with quote

thnks..but if i want do it in a simpler way...using cobol DATE routine
or inbuild functions..please suggest..
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Mar 20, 2009 12:34 am    Post subject:
Reply with quote

Just remember that some months are 30 days, 31 days, 28 days, or 29 days. That makes it rough when you have to use days for the calculations. Check and see if your site has a standard date calculation routine. I developed one in assembler to be called from cobol many years ago, it sure saved a lot of trouble. I received a lot of late night calls from idiots that passed bad data then got bad results and tried to blame me.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 20, 2009 12:40 am    Post subject:
Reply with quote

In The Month difference bw the start date and end date
dick scherrer wrote:
Hello and welcome to the forum,

COBOL has nothing completely automatic.

Does the program use db2?

You might also look into using CEEDAYS (callable service).
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am


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