ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) |
(B) |
(I/B) |
(I) |
Warning: In the case of ADELIA programs, this function is not compatible with C generator.
Description
This predefined function is used to convert an alphanumeric variable to a DATE type variable.
If the alphanumeric date is not valid for the specified format, the result field is reset to *LOVAL.
Syntax
Result = &ALPHA_TO_DATE(Date format;Alphanumeric date)
Parameters
|
Description |
Contents |
Controls |
Result |
DATE type variable. |
Date set as a parameter converted to DATE type. |
|
Date format |
Four-position alphanumeric constant. |
Indicates the date format. |
Mandatory parameter. |
Alphanumeric date |
Alphanumeric constant or variable. |
Alphanumeric field containing a date in the specified format, to be converted to the DATE type. |
Mandatory parameter. |
Important note: The *SYS parameter cannot be used for ADELIA programs. Furthermore, in the case of VADELIA and SADELIA programs, if this function is used in an AS/400 server part, the *SYS value is not taken into account; it is replaced by the *ISO value.
Alphanumeric representation of DATE type fields according to their format:
Format name |
Description |
Format (Default separator) |
Length |
Example |
2-Digit Year Formats |
||||
*MDY |
Month/Day/Year |
mm/dd/yy |
8 |
01/15/18 |
*DMY |
Day/Month/Year |
dd/mm/yy |
8 |
15/01/18 |
*YMD |
Year/Month/Day |
yy/mm/dd |
8 |
18/01/15 |
*JUL |
Julian |
yy/ddd |
6 |
18/015 |
4-Digit Year Formats |
||||
*ISO |
International Standards Organization |
yyyy-mm-dd |
10 |
2018-01-15 |
*USA |
IBM USA Standard |
mm/dd/yyyy |
10 |
01/15/2018 |
*EUR |
IBM European Standard |
dd.mm.yyyy |
10 |
15.01.2018 |
*JIS |
Japanese Industrial Standard - Christian Era |
yyyy-mm-dd |
10 |
2018-01-15 |
*SYS |
Client machine format |
Unknown |
Unknown |
Unknown |
Example
WDATE = &ALPHA_TO_DATE('*EUR';'30.06.2018')
List of predefined functions by topic