Is there a fucntion/way by which I can find the day of week in cobol. In DB2 there is a day of week function which takes a date as input and returns the day of week i.e. 01 - Sunday, 02 - Monday... I need to imitate the same functionality in cobol. Is there a function / way ?
Use the INTEGER OF DATE function, divide the value returned by 7 - the remainder is the DOW.
I don't recall what their numeric values are (and they may also change with the INTDATE compiler option you use), so just pick a date whose DOW you know (e.g. today's date) and build your DOW table from that.
I would also code the INTDATE option in a CBL stmt immediately prior to the IDENTIFICATION DIVISION stmt of your pgm. This will assure that the same "start" is used for every execution of your pgm.