z/OS TSO/E CLISTs
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


&SYS4DATE, &SYS4SDATE, and &SYS4JDATE

z/OS TSO/E CLISTs
SA32-0978-00

Three variables provide the current date in a format that presents years as four-digit numbers. As opposed to the variables that present the current year as two-digit numbers, these variables are capable to handle years beyond 1999.

&SYS4DATE provides the date in the American standard form: month/day/year. If executed on November 22, 2001, the following statement displays the message "Today is 11/22/2001":
WRITE Today is &SYS4DATE
&SYS4SDATE provides the date in a form that can be sorted: year/month/day. If executed on November 22, 2001, the following statement displays the message "Today is 2001/11/22":
WRITE Today is &SYS4SDATE
&SYS4JDATE provides the date in the Julian form: year.days. If executed on November 22, 2001, the following statement displays the message "Today is 2001.326":
WRITE Today is &SYS4JDATE
&SYS4DATE and &SYS4SDATE provide data that contain slashes. As a result, when they appear in expressions on comparative and assignment statements, enclose them in &STR built-in functions. For example, in the following example &SYS4DATE appears in a statement containing comparative expressions; therefore, enclose it in a &STR built-in function. However, the use of &STR is unnecessary on the WRITE statement.
IF &STR(&SYS4DATE) = &STR(11/22/2001) THEN + 
 WRITE On &SYS4DATE, the system was down for &TMIN minutes.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014