Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to calculate next year by using current date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rohinigowda

New User


Joined: 29 Mar 2007
Posts: 1
Location: Bangalore

PostPosted: Wed Nov 14, 2007 10:54 am    Post subject: how to calculate next year by using current date
Reply with quote

Hi,
I need to calculate next year date by using current syatem date.

ex: todays date i will be getting in RUN-CCYY and i want to calculate tax for next year ?
ws-hold-ccyy = RUN-CCYY +1
is it correct to calculate the same. This process always runs before 01/01/xx or the beginning of the new year. it depends on the client.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Nov 14, 2007 10:58 am    Post subject:
Reply with quote

Rohini,

Quote:
This process always runs before 01/01/xx or the beginning of the new year


Quote:
ws-hold-ccyy = RUN-CCYY +1

True if you run the program before the new year..... but not for the second case.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Wed Nov 14, 2007 12:23 pm    Post subject: Reply to: how to calculate next year by using current date
Reply with quote

How about trying the same using DB2

Code:
SELECT CURRENT DATE + 1 YEAR
       FROM SYSIBM.SYSDUMMY1;
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Nov 14, 2007 12:31 pm    Post subject: Reply to: how to calculate next year by using current date
Reply with quote

Quote:
is it correct to calculate the same. This process always runs before 01/01/xx or the beginning of the new year. it depends on the client.


The process has been discussed a few times...

first things to consider ...

DATES ARE TRICKY TO WORK ON..

it makes no sense to carry on normal arithmetic operations on them

adding 1 to the day might go to next month
adding one to the month might go to next year
adding one to the year might switch to/from a leap year

( if You subtract c/next/previous)

the Business needs and constraints must be clearly understood
before a solution can be safely implemented
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
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Wishing everyone a very Happy Diwali ... Rohit Umarjikar General Talk & Fun Stuff 1 Sat Oct 29, 2016 1:54 am
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us