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
 

 

To calucate the difference between 2 dates in COBOL in month

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

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Tue Jul 06, 2010 5:50 pm    Post subject: To calucate the difference between 2 dates in COBOL in month
Reply with quote

Hi,

Can you please tell me how to calculate the differnce between 2 dates in Months in COBOL.

Regards
Lakshmi
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jul 06, 2010 6:18 pm    Post subject:
Reply with quote

well, the complexity depends on what level of COBOL and LE you are at... icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jul 06, 2010 6:29 pm    Post subject:
Reply with quote

are there no inhouse/site written date routines?
this is normal practice in any professional data processing department.
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: Tue Jul 06, 2010 7:48 pm    Post subject:
Reply with quote

varalakshmi.G wrote:
Can you please tell me how to calculate the differnce between 2 dates in Months in COBOL.

How would you do it on paper with pencil?
Give an example or two....
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: Tue Jul 06, 2010 10:47 pm    Post subject: Reply to: To calucate the difference between 2 dates in COBO
Reply with quote

What if DATE-1 were 20100630 and DATE-2 were 20100701. Although the months are different, the difference is only one day.

How would this be resolved?

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Tue Jul 06, 2010 10:52 pm    Post subject: Reply to: To calucate the difference between 2 dates in COBO
Reply with quote

Quote:
How would this be resolved?


the first step would be to define properly the date computations standards
bot from a legal point of view and internal practices...

after that everything will be easy
for example I had a client that for month related computations would round using 15 days

less than 15 days 0 months
more than 15 days 1 month

as I said before the organization standards dictate the rules

/rant on
too often on these forums people forget that the rules should be properly defined
at the proper levels in the organization
and concentrate only on the algorithmic and coding
/rant off
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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