Miscellaneous Functions
-
LAG(VARIABLE[, N])
VARIABLEmust be a numeric or string variable name.LAGyields the value of that variable for the caseNbefore the current one. Results in system-missing (for numeric variables) or blanks (for string variables) for the firstNcases.LAGobtains values from the cases that become the new active dataset after a procedure executes. Thus,LAGwill not return values from cases dropped by transformations such asSELECT IF, and transformations likeCOMPUTEthat modify data will change the values returned byLAG. These are both the case whether these transformations precede or follow the use ofLAG.If
LAGis used beforeTEMPORARY, then the values it returns are those in cases just beforeTEMPORARY.LAGmay not be used afterTEMPORARY.If omitted,
Ndefaults to 1. Otherwise,Nmust 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.MONTHis a month between 1 and 13.DAYis a day between 0 and 31. ADAYof 0 refers to the last day of the previous month, and aMONTHof 13 refers to the first month of the next year.YEARmust be in range.YEAR,MONTH, andDAYmust all be integers.YRMODAresults in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed toYRMODAmust 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 ofVARIABLEhas no associated label, then this function returns the empty string.VARIABLEmay be a numeric or string variable.