System Variables

System variables are special variables created during a working session to keep system-required information, such as the number of cases read by the system, the system-missing value, and the current date. System variables can be used in data transformations.

  • The names of system variables begin with a dollar sign ($).
  • You cannot modify a system variable or alter its print or write format. Except for these restrictions, you can use system variables anywhere that a normal variable is used in the transformation language.
  • System variables are not available for procedures.

$CASENUM. Current case sequence number. For each case, $CASENUM is the number of cases read up to and including that case. The format is F8.0. The value of $CASENUM is not necessarily the row number in a Data Editor window (available in windowed environments), and the value changes if the file is sorted or new cases are inserted before the end of the file.

$SYSMIS. System-missing value. The system-missing value displays as a period (.) or whatever is used as the decimal point.

$JDATE. Current date in number of days from October 14, 1582 (day 1 of the Gregorian calendar). The format is F6.0.

$DATE. Current date in international date format with two-digit year. The format is A9 in the form dd-mmm-yy.

$DATE11. Current date in international date format with four-digit year. The format is A11 in the form dd-mmm-yyyy.

$TIME. Current date and time. $TIME represents the number of seconds from midnight, October 14, 1582, to the date and time when the transformation command is executed. The format is F20. You can display this as a date in a number of different date formats. You can also use it in date and time functions.

$LENGTH. The current page length. The format is F11.0. For more information, see SET.

$WIDTH. The current page width. The format is F3.0. For more information, see SET.