ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) |
(B) |
(I/B) |
(I) |
Description
This predefined function is used to calculate a six-position date by adding a number of days to a beginning 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 given 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 = &CALCULATE_DATE6(Date format;Beginning date;Number of days)
Parameters
|
Description |
Contents |
Controls |
Result |
Six-position numeric variable. |
Date calculated. |
|
Date format |
Three-position alphanumeric variable or constant. |
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. |
Beginning date |
Six-position numeric variable or constant. |
Beginning date to which the number of days set as a parameter is added. |
Mandatory parameter. |
Number of days |
Seven-position numeric variable or constant. |
Number of days to be added to the beginning date. |
Mandatory parameter. |
Note: If this parameter Number of days is negative, the number of days specified is deducted from the beginning date.
Example
ORDER_DATE = 001231
NUMBER = 20
DEADLINE = &CALCULATE_DATE6('YMD';ORDER_DATE;NUMBER)
*
* The deadline date is 010120
*
FORMAT = 'DMY'
END_CONTRACT = 060101
NUMBER = -366
*
ORIGIN_DATE = &CALCULATE_DATE6(FORMAT;END_CONTRACT;NUMBER)
*
* The origin date is 060100
List of predefined functions by topic