DATE (Date) keyword for display files
You use this field-level keyword to display the current date as a constant (output-only) field.
You can specify the location of the field, the DATE keyword, and, optionally, EDTCDE , EDTWRD, COLOR, DSPATR, or TEXT keywords. Positions 17 through 38 must be blank.
The format of the keyword is:
DATE([*JOB|*SYS] [*Y|*YY])
The *JOB value causes the current job date to be displayed. If you do not specify a parameter, the parameter is set to *JOB as default. The *SYS parameter displays the current system date.
If you specify *Y, 2 digits are used to represent the year in the date format that the job attribute DATFMT designates. If you specify *YY, 4 digits are used to represent the year in the date format that the job attribute DATFMT designates. If you do not specify a parameter, the parameter is set to *Y as default.
The W edit code on the EDTCDE keyword returns a correctly formatted date only if a four digit year (*YY) is requested, and the job attribute DATFMT is YMD.
mmddyy
to mm/dd/yy.
The date separator is retrieved from the job attribute DATSEP at run time, and the job attribute DATFMT determines the order of the month, day, and year. (DATFMT can be MDY, DMY, YMD, or JUL, where M=month, D=day, Y=year, and JUL=Julian. DATSEP can be a slash (/), dash (-), period (.), or comma (,).)
The field length is dependent on the following conditions:
- The format that the DATFMT job attribute specifies.
- Whether the date field includes separators. The EDTCDE(Y) keyword controls separators.
- The number of digits used to represent the year. The *Y and *YY parameters on the DATE keyword control the number of year digits.
Option indicators are not valid for this keyword, although option indicators can be used to condition the field on which it is specified.
Example
The following example shows how to specify the DATE keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A 20 1 56DATE(*SYS)
00020A 21 1 56DATE(*Y) EDTCDE(Y)
A
Option indicator 20 causes the system date to be displayed without editing if it is on. Dates with 2 digit years are displayed with editing if option indicator 20 is off and option indicator 21 is on.