Converts dates between internal and external format. It takes the general form:
- p is the special processing operator. Can be any one of the following:
Returns only the day of the month as a numeric value.
Returns only dates stored in the external format in internal format. You can use this in field 7 or 8.
Returns the Julian day (1 - 365, or 1 - 366 for a leap year).
Returns the number of the month (1 - 12).
Returns the name of the month in uppercase letters.
Returns the number of the quarter (1 - 4)
Returns the day of the week as a numeric value (Monday is 1).
Returns the day of the week in uppercase letters (MONDAY - SUNDAY).
Returns the year (up to four digits).
- n is a number from 0 to 4 that specifies the how many digits to use for the year field. If omitted, the year will have four-digits. If n is 0, the year will be suppressed.
- s is a non-numeric character to be used as a separator between month, date, and year. Must not be one of the special processing operators.
Dates are stored internally as integers which represent the number of days (plus or minus) from the base date of December 31, 1967. For example:
If a special processing operator, or an output separator , the default output format is two-digit day, a space, a three-character month, a space, and a four-digit year. If just an output separator is specified, the date format defaults either to the US numeric format "mm/dd/yyyy" or to the international numeric format "dd/mm/yyyy" (where / is the separator). The numeric format can be changed for the duration of a logon session with the DATE-FORMAT command.
Field 8 codes are valid but, generally, it is easier to specify the D code in field 7 for input conversion. Dates in output format are difficult to use in selection processing.
If you are going to use selection processing and you want to use a code which reduces the date to one of its parts, such as DD (day of month), the D code must be specified in field 8.
Field 7 input and output conversions are both valid.
Generally, for selection processing, you should specify D codes in field 7. An exception is when you use a formatting code, such as DM, that reduces the date to one of its parts.
If no year is specified in the sentence, the system assumes the current year on input conversion. If only the last two digits of the year are specified, the system assumes the following years:
00-29: 2000 - 2029
30-99: 1930 -1999
|D Code||Internal Value||Value Returned|
|D||9904||11 FEB 1995|
|DI||11 FEB 1995||9904|
Back to Conversion Processing