9.28 CONVERTDATE
Þ Note: Built-In Function Rules.
Converts format of alphanumeric date.
Using the CONVERTDATE Built-In Function twice and producing 2 different result fields allows you to produce dates such as: THURSDAY 5TH OCTOBER 1987.
For use with
|
Arguments
|
Valid Date Formats
- Date to be converted: A, B, C, D, E, F, G, H, I, J, K, L, M, V, W, X, Y, Z and 1.
- Date to be returned: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z and 1.
- Refer to Date Formats
Return Values
|
Technical Notes
- All dates must have a four character year so that accurate comparisons and calculations can be performed. Where a two character year (e.g. DDMMYY, YYMMDD, MMYY) is supplied the century value is retrieved from the system definition data area. The year supplied is compared to a year in the data area, if the supplied year is less than or equal to the comparison year then the less than century is used. If the supplied year, is greater than the comparison year, then the greater than century is used.
- When using date formats P, Q, R, S, T, U, the date is returned in the format specified in messages BIF0101 and BIF0102 in DC@M01. To have the date returned in a language other than English you should ensure these messages are translated into the appropriate language.
If LANG is something other than ENG or NAT, you will need to ensure the messages exist in the message file for the language you are executing in.
Example
Convert a date field #YMD in date format YYMMDD (D) to date format DDMMYY (B) in field #DMY:
USE BUILTIN(CONVERTDATE) WITH_ARGS(#YMD D B) TO_GET(#DMY)