Day_Of_Week
Syntax: Day_Of_Week(ccyymmdd_DateStr)
Argument:
- ccyymmdd_DateStr is a day expressed as ccyymmdd, where ccyy is the year, mm is the month, and dd is the day. A value of 20180410 represents April 10, 2018.
Return Type: Integer
Description: Returns a number representing the day of the week: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, and 7 = Saturday.
Example:
ACCT_UDVDOW = Day_Of_Week(CRTRAN25.transactionDate);
if ACCT_UDVDOW = 1
then... ;
if ACCT_UDVDOW = 2
then... ;
The previous rule performs different actions depending on the day of the week on which an authorization takes place. It begins by creating a UDV variable, DOW, for the day of the week.
The Day_Of_Week function converts the date contained in the function to a number representing the day of the week. Then any number of if-then statements can link different actions to the possible values of DOW: if DOW = 1 (Sunday) then do one thing, if DOW = 2 (Monday) then do another, and so on.