** ------------------------------------------------------------- ** This is the prototype for the GETDAY procedure. ** ------------------------------------------------------------- 0010 D GetDay PR 10I 0 0020 D InDate D CONST DATFMT(*ISO) ** ------------------------------------------------------------- ** GET DAY OF WEEK as a number 0030 P GetDay B export 0040 D GetDay PI 10I 0 0050 D InDate D CONST DATFMT(*ISO) 0060 D BaseDate C CONST(D'1582-10-14') 0070 D nDayOfWeek S 10I 0 0080 D nDays S 10I 0 ** If the input date is less than 10/14/1582 return -1. 0090 C IF Indate < BaseDate 0100 C return -1 0110 C endIf ** Calculate the number of days since 10/14/1582. 0120 C InDate SubDur BaseDate nDays:*Days ** Call CEEDYWK to calculate the day of the week. 0130 C CallB 'CEEDYWK' 0140 C PARM nDays 0150 C PARM nDayofWeek ** Return the Day of the Week as a numeral, to the caller. 0160 C return nDayOfWeek 0170 P GetDay E