This is a set of system variables which provide different formats of the current system date.
&DATE1 to &DATE17 (excluding &DATE15) supply the current system date in a variety of formats, as listed below:
where:
Is the day of the week as follows:
The day of the month as a 2-digit number
The Julian day within the year as a 3-digit number
The month of the year as a 2-digit number
The month of the year as follows:
The number of days from 1 January 0001 with no leading zeros
The current year as a 4-digit number
The current year as a 2-digit number
Plus or minus relative to Greenwich Mean Time (GMT)
The time accurate to 10-6
The current time
The GMT offset
Examples: &DATEn
&IF &DATE1 GT 98.001 &THEN + &END
&WRITE DATA=TODAY'S DATE IS &DATE2
&TODAY = &SUBSTR &DATE3 1 6
&IF &TODAY EQ 25-DEC &THEN +
&GOTO .XMASDAY
Notes:
The current day is provided in the system variable &DAY.
&DATE6, &DATE7, &DATE8, and &DATE9 are useful where records are to be stored in chronological order.
See the &DATECONV function for the rules that apply to choice of century when converting from a form of the date that expresses the year in two digits (YY) to the form of the year in four digits (YYYY).
Each access to &DATE11 causes the system to re-fetch and synchronize time with the operating system, to format the result to microsecond accuracy. Use of this time should be avoided, to reduce unnecessary overheads, if such accuracy is not required.
| Copyright © 2009 CA. All rights reserved. |
|