The FY and RY date format characters have very precise requirements and are used to handle a specific case in which eight-digit dates are expressed in six characters.
Instead of YYYY or YY, you can specify FY to mean that the first character of the year specifies the decade instead of the “tens” year. The decade can be a character between space (“ “) and 1 (inclusive). For the characters 0 through 9 to be treated as decades in the 20th century, the decade characters have the following meaning:
00 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | |
1700 | spc | ! | " | # | $ | % | ||||
1800 | & | ' | ( | ) | * | + | , | - | . | / |
1900 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
2000 | : | ; | < | = | > | ? | @ | A | B | C |
2010 | D | E | F | G | H | I |
This means that a date of ?70210 is converted to 20570210, or February 10, 2057. The range of valid dates is 00101 (Jan 1, 1740) through I91231 (Dec 31, 2159).
Instead of YYYY or YY, you can also specify RY to mean that the first character of the year specifies the decade and that the entire date is to be 9s complement (to be able to sort dates in reverse order). Note that the entire date and time is treated as a 9s complement number in this case. The decade characters have the following meaning:
00 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | |
1700 | I | H | G | F | E | D | ||||
1800 | C | B | A | @ | ? | > | = | < | ; | : |
1900 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
2000 | / | . | - | , | + | * | ) | ( | ' | & |
2010 | % | $ | # | " | ! | spc |
The date 20570210 is now specified with *29789. The range of valid dates is I99898 (Jan 1, 1740) through 08768 (Dec 31, 2159), the same valid range as when using F instead of R.
While using F and R before month, day, hour, or any other format specifier does not generate a compile error for the XFD, the results are undefined at runtime.
Note that if you use these format specifiers with Acu4GL or Database Connectors, the actual date is written to the database, not the encoded date. That means that the R specifier is not very useful in this scenario (you won’t be able to read forward through a file in reverse date order). This format specifier is more useful with Micro Focus XDBC, where the data is in indexed file format.