IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

If the age is greater than 65 yrs, i need to add one month


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Wed Aug 31, 2005 4:05 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Sep 01, 2005 5:23 am
Reply with quote

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
View user's profile Send private message
nrsmca

New User


Joined: 25 May 2005
Posts: 14

PostPosted: Thu Sep 01, 2005 3:50 pm
Reply with quote

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
View user's profile Send private message
nrsmca

New User


Joined: 25 May 2005
Posts: 14

PostPosted: Thu Sep 01, 2005 3:55 pm
Reply with quote

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
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Thu Sep 01, 2005 5:49 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts USECOUNT greater ZERO CICS 1
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
Search our Forums:

Back to Top