View Full Version : Determine annual holidays to post in a table
10-07-2002, 08:19 AM
Hi Ms. Ann. Roy Nakamura posted this reply to a similar question. Click Roy's Reply Link (http://firstname.lastname@example.orgVMfHb6dae.1@.ef64fd1/0!SearchMark=1#1) to see his response. -Mean 1
10-07-2002, 09:55 AM
Good afternoon, We utilize a Calendar Master file that denotes which days are company holidays for determining work day of the week. We have a fully-automated program that determines the information to populate and within the processing, returns to update the holiday flag appropriately. If you need additional help, email me email@example.com and I can share some of the coding. Thank you - Lee.
10-07-2002, 11:49 AM
Why do you call your calendar file a calendar master file? What does master mean?
10-08-2002, 02:24 AM
Gene, A "master" file is a name commonly used in the mainframe industry by some of us older geeks ;-) It's basically a reference to a specific file that may be used in one or more applications on a permanent basis. This would be in contrast to a file that was used/created temporarily based on application needs. My 2 cents. Terry
10-08-2002, 05:00 AM
T.M. That you? Bret
10-09-2002, 09:16 AM
This has been tested and works. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae404e2/7')
10-09-2002, 10:02 AM
I don't know the rules for Easter but the other holidays have rules that could be used in an RPG program using date arithmetic and day of week calculations to display a "Holiday Window".
10-25-2002, 10:03 AM
Below is the calculation of two methods to figure the Easter holiday. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae404e2/9')
11-18-2002, 07:33 AM
I have found holiday determination to be quite easy (except for Easter/Good Friday), once I discovered some hints that are easy to overlook. One thing I have marveled at is the lengths some code goes to to determine if a day is the nth x-day of the month; for example, if a date is the 4th Thursday of November, or is the last Monday of May. Here's a hint that I've discovered along the way for determining if a date is the nth x-day. First, get the day of week <pre> weekDay = %rem(%diff(yourDate:d'0001-01-01':*d):7) + 1; </pre> where Monday is 1 and Sunday is 7. Once you know if you have a specific day to check (If you have Thursday and you are checking for Thanksgiving, or Monday for Memorial Day), just check the day of month. The first x-day of a month will be one of the first 7 days. No need to do any complicated calculations or counting: If you have a September Monday, and the day is somewhere between 1 through 7, then you have Labor Day. If you have a November Thursday, and the day is between 22 and 28, it is Thanksgiving. Likewise, a May Monday between 25 and 31 is Memorial Day. I also like to use a similar method to determine an observed holiday. If I have a December date where the day is 25, or the day is Friday the 24th, or Monday the 26th, Then it is Christmas. As for Easter, there is an accepted algorithm called the Mallen Algorithm (http://www.assa.org.au/edm.html). It is easy to implement in RPG, or COBOL, or Java. Remember also that Easter will always fall somewhere between 3/22 and 4/25. I won't even check for Easter if the date is not in that range.
11-18-2002, 07:35 AM
I would like rpg code to figure dates of Easter, Memorial Day, Labor Day, and Thanksgiving for any given year. These dates will highlight on a pop up calender.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.