Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
EnjoyMF

New User

Joined: 27 May 2005
Posts: 88

 Posted: Wed Aug 31, 2005 4:05 pm    Post subject: If the age is greater than 65 yrs, i need to add one month 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

mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Thu Sep 01, 2005 5:23 am    Post subject: 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.
nrsmca

New User

Joined: 25 May 2005
Posts: 14

 Posted: Thu Sep 01, 2005 3:50 pm    Post subject: 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.
nrsmca

New User

Joined: 25 May 2005
Posts: 14

 Posted: Thu Sep 01, 2005 3:55 pm    Post subject: 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.
EnjoyMF

New User

Joined: 27 May 2005
Posts: 88

 Posted: Thu Sep 01, 2005 5:49 pm    Post subject: Re: date logic 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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am Cobol program till a given time or fo... ankita agarwal COBOL Programming 7 Fri May 18, 2018 2:24 pm Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us