The data type returned by STATLAST is either the data type of the dimension or dimension surrogate value or an
INTEGER that indicates its position in the default status list of the dimension. See "Automatic Data Conversion of Returned Dimension Values".
A text expression whose value is the name of a dimension, a dimension surrogate, or a valueset.
The dimension value returned by STATLAST is converted to a number or a text value, as appropriate to the context. Suppose, for example, that
jun95 is the sixth
month value but the last value in the current status list. The value of
STATLAST(month) can be assigned either to a text variable or a numeric variable.
The following statements produce a text output value .
DEFINE textvar TEXT TEXTVAR = statlast(MONTH) SHOW textvar
In contrast, these statements produce a numeric output value.
DEFINE intvar INTEGER INTVAR = STATLAST(month) SHOW INTVAR
The following line from a program uses STATLAST to limit
month to the values in the status, beginning with a month that has been stored previously in a variable called
onemonth, and ending with the last value in the status.
LIMIT month KEEP onemonth TO STATLAST(month)
STATLAST is used here, rather than a particular
month value, so that the limit can work on any status list.