In this example...
d,"1/4",
…the d indicates it is a date format, as opposed to a number format (n). The first digit (1) indicates the date format (MM/DD/YY). The forward slash (/) indicates the separator character (/) and the third digit (4) indicates the number of digits in the year. See DateFmt for the complete list of date formats.
Note | Because of year 2000 considerations, use four-digit years. |
In cases where you do not need a separator, such as format 4 or B, you can specify the date as “4/2” for format 4 with a two-digit year. The system ignores the slash (/).
This example shows the date format as it looks in the FAP file. The easiest way to enter date formats is through Studio, on the field’s Properties window.
Studio will then create the date format in the FAP file for you.
When you choose Date Format as the type, you can choose from this list of date formats. The table also shows the corresponding date format code Studio creates in the FAP file:
Here is a list of the separators you can choose from in the Separators field on the Attributes tab of the variable field’s Properties window.
In the Separator field, choose... |
To use this character as the separator... |
00/00/00 (default) |
/ (a slash appears in the FAP file) |
00-00-00 |
- (a dash appears in the FAP file) |
00.00.00 |
. (a period appears in the FAP file) |
00,00,00 |
, (a comma appears in the FAP file) |
00 00 00 |
blank (a “b” appears in the FAP file) |
In the Year Size field on the Attributes tab of the variable field’s Properties window, you can choose from these options...
To use... |
Select... |
A two-digit year such as 01/01/13 (use only if the year is in current century) |
2 (a “2” appears in the FAP file) |
Only a two-digit year such as 01/01/13 (if you enter anything other than a two-digit year, you will receive an error) |
3 (a “3” appears in the FAP file) |
A four-digit year such as 01/01/2014 |
4 (a “4” appears in the FAP file) |
Only a four-digit year such as 01/01/2014 (if you enter anything other than a four-digit year, you will receive an error) |
5 (a “5” appears in the FAP file) |
The year as entered without changing it |
Default (a blank space appears in the FAP file) |
You can force 2-digit years when you use the FmtDate rule, even if doing so means the date may not be interpreted correctly when it is compared to the century cut-off date. To force a 2-digit year, you must specify the output format as “1/3” instead of “1/2”. Here is an example:
;0;0;DRVR-BIRTH-DT;1022;8;DRVR-BIRTH-DT;0;8;d,"B4",d,"1/3";
FmtDate;5,DRVRREC01,;N;N;N;N;3367;3600;11011;
The 3 is a format mask (normally used for input) which means 2-digits and only 2-digits.
The century cut-off date is used to determine the century for 2-digit years. This date defaults to 50, but you can change it using this INI option:
< Control >
Anything less than or equal to the cut-off year is considered to fall in the current century. For instance using the default of 50, 13 would be interpreted as 2014. Anything greater than the cut-off year is considered to fall in the previous century. For instance, again using the default of 50, 88 would be interpreted as 1988.
This is important when you have to determine the years or days between two dates.
There is a scenario where the system overrides a 2-digit year output. This only happens when the input has 4-digits and the output has 2-digits and the resulting 2-digit output does not yield the same results when read in again.
For instance, suppose your input is 01/01/1927 and the cutoff year is 50. Normally any 2-digit year with a value less than 50 is considered part of the current century. So if the system outputs the data as 01/01/27 and then tries to read this date back in, you would get 01/01/2025 and not 01/01/1927.
The system changes its normal behavior because it is designed to be able to read its own output and come up with the result originally provided in the original input.
If, however, you specifically tell the system you only want two digits, you will get that output, but the system may not be able to read it back in and get the same results.
© Copyright 2014, Oracle and/or its affiliates. All rights reserved. Legal notices.