Miscellaneous Functions
-
LAG(VARIABLE[, N])
VARIABLE
must be a numeric or string variable name.LAG
yields the value of that variable for the caseN
before the current one. Results in system-missing (for numeric variables) or blanks (for string variables) for the firstN
cases.LAG
obtains values from the cases that become the new active dataset after a procedure executes. Thus,LAG
will not return values from cases dropped by transformations such asSELECT IF
, and transformations likeCOMPUTE
that modify data will change the values returned byLAG
. These are both the case whether these transformations precede or follow the use ofLAG
.If
LAG
is used beforeTEMPORARY
, then the values it returns are those in cases just beforeTEMPORARY
.LAG
may not be used afterTEMPORARY
.If omitted,
N
defaults to 1. Otherwise,N
must be a small positive constant integer. There is no explicit limit, but use of a large value will increase memory consumption. -
YRMODA(YEAR, MONTH, DAY)
YEAR is a year, either between 0 and 99 or at least 1582. Unlike other PSPP date functions, years between 0 and 99 always correspond to 1900 through 1999.MONTH
is a month between 1 and 13.DAY
is a day between 0 and 31. ADAY
of 0 refers to the last day of the previous month, and aMONTH
of 13 refers to the first month of the next year.YEAR
must be in range.YEAR
,MONTH
, andDAY
must all be integers.YRMODA
results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed toYRMODA
must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1. -
VALUELABEL(VARIABLE)
Returns a string matching the label associated with the current value ofVARIABLE
. If the current value ofVARIABLE
has no associated label, then this function returns the empty string.VARIABLE
may be a numeric or string variable.