Previous Topic: LOCIMOD()

Next Topic: LU2()

LOCSTEM()

Use the LOCSTEM() function to determine the values used for a stem variable's indexes.

Syntax

The LOCSTEM() function has this syntax:

index = LOCSTEM(stem.,[num])

Arguments

The LOCSTEM() function takes these arguments:

stem.

Stem variable's name (including the period).

num

Number of a stem item.

index

Returns one of the following:

(if num is specified): Value of the index for the specified stem item.

(if num is omitted or zero): Count of stem elements.

(if an error occurs): Error text.

Indexes are returned in the same order as they were created.

Return Codes

The LOCSTEM() function produces these return codes:

101 - 102 ARG n MISSING OR INVALID

121 STEM VARIABLE NOT FOUND

122 STEM HAS NO MEMBERS

Example

Consider this example:

limit = locstem('ABC.')             /* Obtain count of members */
do i = 1 to limit
   index = locstem('ABC.',i)        /* Obtain value for index  */
   say 'ABC.'||index 'Has value: ABC.index
   end i