I had a similar situation a few years back , the way I got round it was to create a Cobol file
FD DAYSFILE
RECORD CONTAINS 8 CHARACTERS
LABEL RECORDS ARE STANDARD.
01 DAYSREC.
03 DAYSALT1.
05 DAYSDAYCODE PIC 9.
05 DAYSKEY.
07 DAYSDATE PIC 9(8) COMP-6.
03 FILLER PIC XXX.
What I did was I had a temporary program that created the file using a date in the past. Knowing the day of the week for this date I created a record and set the daycode to be a numeric value i.e. 1 - Sunday , 2 - Monday .....
I then added 1 to the day and set the following day of the week code to + 1 , I continued this process for several years (30 years) creating a record with the date and the relevant day of the week code (of course when the day code was 8 it was defaulted back to 1)
The end result is that I had a file that stored the day of the week permantly , and later programs that were developed could read this file to pick up the day of week.
This was done for commercial programs on a large machine with ample storage capacity and hence may not be viable for some.
The reply by Slade may be far more easily to implement , it was just that I found the reply interesting , even thou a few years too late for my requirements. What I have works for my circumstances and changing my programs would be a lot of work for no gain.
Cheers