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 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
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 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 How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm


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