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
 
Add number of years to a given date field

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

New User


Joined: 28 Aug 2007
Posts: 18
Location: Chennai

PostPosted: Wed Aug 06, 2008 12:34 pm    Post subject: Add number of years to a given date field
Reply with quote

Hi,
I want to add number of years to a given date field (yyyy/mm/dd) in COBOL. Is there any cobol function to do this? If someone knows help me out.


ex: i have a date field: 1982/10/28
i have to find out when he attains the age 65.


Thanks in advance
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 06, 2008 12:52 pm    Post subject:
Reply with quote

is your date field the birth date?
Back to top
View user's profile Send private message
Vidhya Karthi

New User


Joined: 28 Aug 2007
Posts: 18
Location: Chennai

PostPosted: Wed Aug 06, 2008 12:55 pm    Post subject:
Reply with quote

Yes.
Back to top
View user's profile Send private message
kumara.kranthi

New User


Joined: 03 Nov 2006
Posts: 21

PostPosted: Wed Aug 06, 2008 1:01 pm    Post subject:
Reply with quote

try like this

use reference modification.


COMPUTE WS-DATE = WS-DATE(1:4) + 65
Back to top
View user's profile Send private message
Vidhya Karthi

New User


Joined: 28 Aug 2007
Posts: 18
Location: Chennai

PostPosted: Wed Aug 06, 2008 2:02 pm    Post subject:
Reply with quote

Hi Kumara,
Thanks for the reply. But that doesn't give the proper format. I want the exact date field in the format (yyyy/mm/dd).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 06, 2008 2:55 pm    Post subject:
Reply with quote

this is a typical dbz comment desparaging the OP for being really thick headed.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
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 Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

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