View previous topic :: View next topic
|
Author |
Message |
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hello All
I have requirement where Cancellation effective date is falling on weekends or Holidays then it should populate next business date. i.e. if calculated Cancellation eff dt is falls on saturday then we need to populate it to next monday's date in COBOL pgm.
Do I need to create a new copybook where all weekends dates/holidays will be listed and then I will use it in my program, but then I have to update this COPYBOOK every year.. but will this be fine?
How this can be achieved? Can anyone please provide solution? Or is there any other way?
Thanks in advance. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why not speak to the designers of the application and/or to the application support group
usually calendar issues are dealt by <organisation wide> support routines in a standard way
no reason to re-invent the wheel |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Weekends and holidays, U.S, or otherwise, follow certain rules and are therefore predictable (albeit not always in the goyish calendar). A better solution, IMNSHO, would be to create an external subroutine that returns the next business date. |
|
Back to top |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hello Akatsukami
What is IMNSHO? and my doubt is that how would i determine which is next business day? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
apandey wrote: |
Hello Akatsukami
What is IMNSHO? and my doubt is that how would i determine which is next business day? |
IMNSHO = In My Not So Humble Opinion.
The rule here is: if cancellation effective date falls on a weekend (Saturday or Sunday) or a holiday, move it the next business day.
Use intrinsic or LE functions (be aware that they are not compatible) to get a day number, and determine the day of the week from it. If it is a Saturday, add 2; if a Sunday, add 1.
The U.S. holidays that my client celebrates are:
- New Year's Day: 1 January
- Memorial Day: last Monday in May
- Independence Day: 4 July
- Labor Day: first Monday in September
- Thanksgiving: fourth Thursday in November
- Christmas: 25 December
(Your list may be different.)
Check if your modified cancellation date falls on one of these; if so, add 1. Note that New Year's Day, Independence Day, and Christmas may fall on a Friday, so a second round of weekend checking is necessary. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The Calendar will be designed such that you know these things.
IMNSHO is In My Not-So-Humble Opinion, a more trustworthy version of In My Humble Opinion. |
|
Back to top |
|
|
|