View previous topic :: View next topic
|
Author |
Message |
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
hi friends
i have a requirement where i need to find if the age is greater than 65years, if it is then i need to add one month to it...
how can this done though cobol..plz provide me the input's in details
Regards
prasad |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi prasad,
If, as your pseudo name implies, you enjoy mainframes, why not look up intrinsic date functions for the compiler you're using (I assume it's COBOLII or later - click the "manuals" tab on the top line of this panel) and attack the problem yourself?
You'll learn a lot more than if you relied on us to do it for you. We'll be happy to help you w/any ques you may have. |
|
Back to top |
|
|
nrsmca
New User
Joined: 25 May 2005 Posts: 14
|
|
|
|
w-s.
01 DOBdate.
02 Day1 pic 9(2).
02 Mon1 pic 9(2).
02 Year1 pic 9(4).
P-D.
if (day(CurrDate) - day(DOB))/365 > 65
compute Mon1 = Mon1 + 1
End-if. |
|
Back to top |
|
|
nrsmca
New User
Joined: 25 May 2005 Posts: 14
|
|
|
|
w-s.
01 DOBdate.
02 Day1 pic 9(2).
02 Mon1 pic 9(2).
02 Year1 pic 9(4).
P-D.
if (day(CurrDate) - day(DOB))/365 > 65
if mon1 <> 12
compute Mon1 = Mon1 + 1
else
compute Year1 = Year1 + 1
compute Mon1 = 1
End-if. |
|
Back to top |
|
|
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
Hi nrsmca
the logic is fine
but i am not sure that this will work exactly
i suppose we forgot to take care of the leap years in between
bye
chaitanya |
|
Back to top |
|
|
|