View previous topic :: View next topic
|
Author |
Message |
Vidhya Karthi
New User
Joined: 28 Aug 2007 Posts: 18 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
is your date field the birth date? |
|
Back to top |
|
|
Vidhya Karthi
New User
Joined: 28 Aug 2007 Posts: 18 Location: Chennai
|
|
|
|
Yes. |
|
Back to top |
|
|
kumara.kranthi
New User
Joined: 03 Nov 2006 Posts: 21
|
|
|
|
try like this
use reference modification.
COMPUTE WS-DATE = WS-DATE(1:4) + 65 |
|
Back to top |
|
|
Vidhya Karthi
New User
Joined: 28 Aug 2007 Posts: 18 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
this is a typical dbz comment desparaging the OP for being really thick headed. |
|
Back to top |
|
|
|