Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

COBOL Programming :: RE: How to find the first monday of the week.

$
0
0
Author: mistah kurtz
Posted: Mon Nov 28, 2016 7:29 pm (GMT 5.5)

Here is a small rexx program to achieve what you want:
Code:
/* rexx */
days = "Monday Tuesday Wednesday Thursday Friday Saturday Sunday"
numofweek = 05

dayofwk = wordpos( date(weekday), days )

basedate = date('base')

nextmondate = basedate - dayofwk + numofweek * 7 + 1

say 'day  is : ' date(weekday,nextmondate,'base')
say 'date is : ' date('standard',nextmondate,'base')


Viewing all articles
Browse latest Browse all 8500

Trending Articles