I have a file with multiple dates and need to determine which is a processing day (B), Mon - Fri, but I need to account for weekends (N), Sat Sun, and holidays.
This is what I used, but is there a more efficient without creating a COBOL program....any suggestions would be greatly appreciated.
Date is formatted as CCYY-MM-DD, so I convert to CCYYMMDD before I execute the following code.
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(111:25,10,UFF,TO=ZD,LENGTH=8)),
IFTHEN=(WHEN=INIT,BUILD=(1,110,119:111,8,Y4T,WEEKDAY=DIGIT1)),
IFTHEN=(WHEN=(119,1,SS,EQ,C'1,7',OR,111,8,ZD,EQ,20240527,
OR,111,8,ZD,EQ,20240101,OR,111,8,ZD,EQ,20240219,
OR,111,8,ZD,EQ,20240101,OR,111,8,ZD,EQ,20240611,
OR,111,8,ZD,EQ,20240704,OR,111,8,ZD,EQ,20241225),
OVERLAY=(110:C'N')),
IFTHEN=(WHEN=(119,1,SS,EQ,C'2,3,4,5,6'),OVERLAY=(110:C'B'))
I changed it to below.
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(111:25,10,UFF,TO=ZD,LENGTH=8)),
IFTHEN=(WHEN=INIT,BUILD=(1,110,119:111,8,Y4T,WEEKDAY=DIGIT1)),
IFTHEN=(WHEN=(119,1,SS,EQ,C'1,7'),OVERLAY=(110:C'N')),
IFTHEN=(WHEN=(119,1,SS,EQ,C'2,3,4,5,6'),OVERLAY=(110:C'B')),
IFTHEN=(WHEN=(111,8,ZD,EQ,20240527,
OR,111,8,ZD,EQ,20240101,OR,111,8,ZD,EQ,20240115,
OR,111,8,ZD,EQ,20240527,OR,111,8,ZD,EQ,20240619,
OR,111,8,ZD,EQ,20240704,OR,111,8,ZD,EQ,20241225),
OVERLAY=(110:C'N'))
Both executes but I don't get the desired results, which is for holidays that fall on a weekday, to have a "N" in position 110.