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

Exclusion of US Holidays in 'Cancellation effective date'


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

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Sep 18, 2015 3:34 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 18, 2015 3:41 pm
Reply with quote

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

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Sep 18, 2015 3:46 pm
Reply with quote

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

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Sep 18, 2015 3:49 pm
Reply with quote

Hello Akatsukami

What is IMNSHO? and my doubt is that how would i determine which is next business day?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Sep 18, 2015 4:06 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 18, 2015 4:07 pm
Reply with quote

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
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top