STATFIRST

 The STATFIRST function returns the first value in the current status list of a dimension or a dimension surrogate, or in a valueset.

Return Value

The data type returned by STATFIRST 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.The dimension value returned by STATFIRST is converted to a number or a text value, as appropriate to the context. See Example 8-107, "Assigning value of STATFIRST to Variables of Different Types".

Syntax

STATFIRST(dimension)

Parameters

dimension

A text expression whose value is the name of a dimension, a dimension surrogate, or a valueset.

Examples

Example 8-107 Assigning value of STATFIRST to Variables of Different Types

The following statements

DEFINE textvar TEXT
textvar = STATFIRST(month)
SHOW textvar

produce this output.

Jun95

In contrast, these statements

DEFINE intvar INTEGER
intvar = STATFIRST(month)
SHOW INTVAR

produce this output.

6

Example 8-108 STATFIRST with KEEP

The following line from a program uses STATFIRST to limit month to all values in the status up to a value that has been stored previously in a variable called onemonth. The keyword KEEP means the new status is always a subset of the old status.

LIMIT month KEEP STATFIRST(month) TO onemonth

STATFIRST is used here, rather than a particular month value, so that the limit can work on any status list.