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
 
If the age is greater than 65 yrs, i need to add one month

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: If the age is greater than 65 yrs, i need to add one month
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: date logic
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    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
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts Cobol program till a given time or fo... ankita agarwal COBOL Programming 7 Fri May 18, 2018 2:24 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm

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