Remember the following rules when using the user date:
UDATE, when specified in positions 30 through 43 of the output specifications, prints a 6-character numeric date field. *DATE, when similarly specified, prints an 8-character (4-digit year portion) numeric date field. These special words can be used in three different date formats:
Month/day/year
Year/month/day
Day/month/year
Use the DATEDIT keyword on the control specification to specify the date formats of UDATE and *DATE:
DATEDIT
UDATE format
*DATE format
*MDY
*MDY
*USA (mmddyyyy)
*DMY
*DMY
*EUR (ddmmyyyy)
*YMD
*YMD
*ISO (yyyymmdd)
Note that the DATEDIT keyword also controls the format of the Y edit code.
If this keyword is not specified, the default is *MDY.
For an interactive job or batch program, the user date special words are set to the value of the job date when the program starts running in the system. The value of the user date special words are not updated during program processing, even if the program runs past midnight or if the job date is changed. Use the TIME operation code to obtain the time and date while the program is running.
UMONTH, *MONTH, UDAY, *DAY, and UYEAR when specified in positions 30 through 43 of the output specifications, print a 2-position numeric date field. *YEAR can be used to print a 4-position numeric date field. Use UMONTH or *MONTH to print the month only, UDAY or *DAY to print the day only, and UYEAR or *YEAR to print the year only.
UDATE and *DATE can be edited when they are written if the Y edit code is specified in position 44 of the output specifications. The DATEDIT(fmt{separator}) keyword on the control specification determines the format and the separator character to be inserted; for example, 12/31/88, 31.12.88., 12/31/1988.
UMONTH, *MONTH, UDAY, *DAY, UYEAR and *YEAR cannot be edited by the Y edit code in position 44 of the output specifications.
The user date fields cannot be modified. This means they cannot be used:
In the result field of calculations
As factor 1 of PARM operations
As the factor 2 index of LOOKUP operations
With blank after in output specifications
As input fields
The user date special words can be used in factor 1 or factor 2 of the calculation specifications for operation codes that use numeric fields.
User date fields are not date data type fields but are numeric fields.