ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) |
(B) |
(I/B) |
(I) |
Description
This predefined function is used to calculate the number representing the day of the week for a six-position date.
Note: The century is calculated using a limit year. The calculation rule is as follows:
IF Year in date >= Limit year
Þ CENTURY = 19
ELSE
Þ CENTURY = 20
The default value of this limit year is 50. It can be changed as described below:
-
- On AS/400 (Adelia iSeries RPG programs or AS/400 server part): by modifying the data area HA#LYC. The data area taken into account is the first found in the list of libraries. In the software supplied, it is stored in the HA#XRUN and HA2SLIB libraries.
- On Windows (Windows client Visual Adelia programs or Windows server part, C-generated Adelia programs): by specifying it in the "Display" tab of the interface configuration tool (run confintw.exe).
- In Java (Adelia Cloud client, Adelia Web client, Java server, Java client): by modifying the value of the DATE6_YEAR_LIMIT key in the CfgConfiguration.properties file.
With this predefined function, the date set as a parameter is checked. If it is not valid, the function is not run and the result field is reset to zero.
Syntax
Result = &DAY_WEEK6(Date format;Date)
Parameters
|
Description |
Contents |
Controls |
Result |
One-position numeric variable. |
Number representing the day of the week corresponding to the date set as a parameter. Possible values: 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 Saturday |
|
Date format |
Three-position alphanumeric constant or variable. |
Format for the date set as a parameter. Possible values: 'DMY' Day/Month/Year 'DYM' Day/Year/Month 'MDY' Month/Day/Year 'MYD' Month/Year/Day 'YMD' Year/Month/Day 'YDM' Year/Day/Month |
Mandatory parameter. |
Date |
Six-position numeric constant or variable. |
Date for which the number of the week day is to be calculated. |
Mandatory parameter. |
Example
PAYMENT_DATE = 311200
DAY = &DAY_WEEK6('DMY';PAYMENT_DATE)
*
* DAY is equal to: 5 (Thursday)
IF DAY = 1
* if Sunday, add 1
PAYMENT_DATE = &CALCULATE_DATE6('DMY';PAYMENT_DATE;1)
END
List of predefined functions by topic